nabrugir
nabrugir

Reputation: 1869

Bandstop filter with Matlab

I want to design a bandstop filter at 6.7Hz (6.2 to 7Hz). I am using the function designfilt but the filter is a passband.

bsFilt = designfilt('bandstopfir','FilterOrder',3, ...
         'CutoffFrequency1',6.2,'CutoffFrequency2',7, ...
         'SampleRate',256);
fvtool(bsFilt)

bandstop filter 6.2 to 7Hz, order 3

If I increase the order to 120 I get a bandstop filter. However, what is the effect of increasing the order?

 bsFilt = designfilt('bandstopfir','FilterOrder',120, ...
             'CutoffFrequency1',6.2,'CutoffFrequency2',7, ...
             'SampleRate',256);
    fvtool(bsFilt)

bandstop filter 6.2 to 7Hz

Is there any better way to design a filter or filter my signal from 6.2 to 7Hz? The sample rate is 256Hz.

Upvotes: 1

Views: 530

Answers (1)

kipar
kipar

Reputation: 507

The higher an order of filter, the more coefficient algorithm have to fit a filter to your request. Downside is that high order filter is harder to implement both in hardware (where you will need more elements and it will be more suspectible to noise) and in software (where you will need more data points and it will be more suspectible to calculation error). I think there may be other downsides, i'm not expert in this area. So with third-level filter it is just impossible to make a bandstop filter. Use any order that produce good enough results.

Upvotes: 1

Related Questions