Matlab filter design help

Matlab filter design help

Author
Discussion

Otispunkmeyer

Original Poster:

12,611 posts

156 months

Thursday 30th May 2013
quotequote all
Hey guys, I am trying to re-create a low pass FFT filter I used in Origin labs in Matlab. In Origin, you plot your data, select it, go to analysis, chose FFT filter and then apply a low-pass FFT. You can then use sliders to pick the right cut-off frequency. Sadly that is about as deep as it goes. There is no clue as to what is going on in the back ground.

I need to generate a similar filter in matlab as I want to perform this filter on a large number of data sets.

I just cant get my head around what the Filter Design tool wants.

I know I want low pass, but do I want IIR or FIR type (analogue or digital) filters? What is my sampling rate/frequency supposed to be? My data sets are 9900 data points long, with 4 x 10^-10 seconds between points (this sampling rate is what was used by the oscilloscope 2.5 GHz). I mean do I set matlabs sample rate to 2.5GHz? 5GHz?

Butterworth? Chebyshev?

Confusing!

Krikkit

26,544 posts

182 months

Thursday 30th May 2013
quotequote all
I find the easiest way to sort this kind of problem is to find already-written code - try this from StackOverflow for a bit of guidance.

p.s. Sample rate should be 2.5GHz.

Edited by Krikkit on Thursday 30th May 16:05

Otispunkmeyer

Original Poster:

12,611 posts

156 months

Thursday 30th May 2013
quotequote all
Cheers pet! I will take a look at that.
Edit: Ahh seen this one already. Not sure its what I want as they are using windows and just looking at sine waves. My signal is a right mess... there is lots of HF noise, there is also a HF oscillation caused by displacement current before the actual current flows. The latter is a lower frequency thankfully! So I am hoping to pull it out of the mess.

Edited by Otispunkmeyer on Thursday 30th May 16:41

Zad

12,704 posts

237 months

Saturday 1st June 2013
quotequote all
FIR / IIR work in the discrete sampled domain, not the frequency domain (the output of the FT). To filter a frequency domain signal, you just multiply each frequency bin by a scaling factor. Zeroing it if you want to remove it completely. Then performing an inverse FFT to get it back into the "real" signal domain. It takes more horsepower than an FIR/IIR but is the most flexible system. Handling 10K points shouldn't be a big problem for any processor made this century.

An FIR / IIR removes the need to perform the Fourier transforms, but is quite a bit trickier to derive the filter coefficients if you do it manually. As you have seen though, there is quite a bit of software which will do the job for you.

FIR filters are filters without any feedback, but IIR has feedback, so the filter cutoffs can be steeper, but it risks going into oscillation.

Filter types have different trade-offs. Some have gain ripple in the stop band, others in the pass band, others in both. Some have steeper slopes to the filter skirts. Some filter types are capable of retaining the original signal phase or group delay, others aren't. There are always trade-offs to be made and it is a rather large subject.

http://en.wikipedia.org/wiki/Filter_design