4

I have complex frequency response data (of an analog system) in the range of 100 Hz to 100 GHz, and it is sampled in frequency with logarithmic spacing. I would like to be able to turn this into a filter in MATLAB such that I can multiply it with the fft of time-domain signal.

I'm not seeing a good match when using invfreqs. What is the best way to do this?

CMDoolittle
  • 628
  • 3
  • 12
  • do you want a continuous-time or a discrete-time filter? invfreqs is for c.t. – David Wurtz Jul 08 '15 at 18:35
  • This is one of my confusions... the freq response data is from an analog system, so I would like continuous-time filter, but I need to filter a discrete time signal in MATLAB, obviously... – CMDoolittle Jul 08 '15 at 19:02
  • do you know the sampling rate of the discrete time signals that you want to filter? – David Wurtz Jul 08 '15 at 19:49
  • So, this is just for modeling purposes... I am creating the signal in matlab and can sample it however – CMDoolittle Jul 08 '15 at 19:50
  • I'd suggest to use the frequency sampling method; what you would have to do first is convert your log frequency samples into linearly spaced samples. Then you can simply apply an IFFT, and - if you like - a window to get some smoothing. – Matt L. Jul 08 '15 at 20:15
  • I've also been playing with tfest() from the System Identification Toolbox. The 2nd order estimate is ok except that the passband of my freq response is smooshed... the 3rd order estimate un-smooshes the passband but boosts the gain at low frequencies by 50 dB! Higher orders don't help... – CMDoolittle Jul 08 '15 at 20:43
  • Would it be possible to fit a quotient of two polynomials through this data; and/or exponents (time time delays)? – fibonatic Jul 09 '15 at 01:46

2 Answers2

1

Use FDLS (Frequency Domain Least Squares) to create a model of your measured frequency response. Use the frequency response of that model, evaluated at the FFT bin frequencies, as your filter.

Alternate: if a low-order IIR (or perhaps even FIR) model provides a good-enough fit, then use the model as your filter for direct time-domain convolution.

Greg Berchin
  • 134
  • 1
  • 3
  • Hi Greg, have you seen http://home.mit.bme.hu/~bank/parfilt/ which also uses Least-Squares for filter design? Since their paper doesn't cite you, I was wondering if there is any connection between your FDLS technique and the one used by Bank? Thanks. – Ben Voigt May 16 '16 at 16:52
0

If I understand your original question, it seems that you want to multiply some given complex frequency response sequence and the FFT samples of a time-domain "test" sequence to produce a filtered-signal's spectral samples. Unless I'm missing something, if you have N complex frequency response samples then just multiply those samples by the complex spectral samples of a standard N-point FFT of your time-domain "test" sequence. (No need to worry about linear or log freq axes.) This will yield the complex spectral samples of the "filtered-signal".

If you then want to compute the corresponding time-domain filtered-signal sequence, just compute the inverse FFT of the filtered-signal's spectral samples. Warning: to compute an inverse FFT you must ensure that your filtered-signal's spectral samples cover the full freq range of zero Hz –to- fs Hz and have the appropriate conjugate symmetry.

Richard Lyons
  • 5,777
  • 13
  • 25
  • I think the linear vs log frequency axis does matter. FFT is always a linear spacing, while the data I was working with came from a simulation that performed a log freq sweep, over a huge range, which made interpolating to a linear scale difficult because the new vector has to be of a huge length if you want to resolve low frequencies at all. – CMDoolittle Sep 14 '15 at 02:43
  • Did you implement the processing that I suggested? Did my suggested process solve your problem? – Richard Lyons Sep 15 '15 at 12:42