4
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ do you want a continuous-time or a discrete-time filter? invfreqs is for c.t. $\endgroup$ – David Wurtz Jul 8 '15 at 18:35
  • $\begingroup$ 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... $\endgroup$ – CMDoolittle Jul 8 '15 at 19:02
  • $\begingroup$ do you know the sampling rate of the discrete time signals that you want to filter? $\endgroup$ – David Wurtz Jul 8 '15 at 19:49
  • $\begingroup$ So, this is just for modeling purposes... I am creating the signal in matlab and can sample it however $\endgroup$ – CMDoolittle Jul 8 '15 at 19:50
  • $\begingroup$ 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. $\endgroup$ – Matt L. Jul 8 '15 at 20:15
1
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ Hi Greg, have you seen 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. $\endgroup$ – Ben Voigt May 16 '16 at 16:52
0
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – CMDoolittle Sep 14 '15 at 2:43
  • $\begingroup$ Did you implement the processing that I suggested? Did my suggested process solve your problem? $\endgroup$ – Richard Lyons Sep 15 '15 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.