can't use hamming window to design bandpass signal with designfilt

5 views (last 30 days)
here is the FIR passband I want to design
  • lower stopband edge: 0.3π
  • upper stopband edge: 0.6π
  • lower passband edge: 0.4π
  • upper passband edge: 0.5π
  • stopband attenuation As = 50 dB
  • passband ripple Rp = 0.5 dB
here is the code I use
bpFilt = designfilt('bandpassfir','PassbandFrequency1',0.4,'PassbandFrequency2',0.5,'StopbandFrequency1',0.3,'StopbandFrequency2',0.6,'PassbandRipple',0.5,'StopbandAttenuation1',50,'StopbandAttenuation2',50,'DesignMethod','Window','hamming');
fvtool(bpFilt)
dataIn = randn(1000,1);
dataOut = filter(bpFilt,dataIn);
Here is the error I got
Error using designfilt>parseAndDesignFilter (line 489)
All inputs except the filter response must be in the form of name-value pairs.
Error in designfilt (line 213)
[err,requestedResponse,parseParams,h] = parseAndDesignFilter(inputParamValueNames, varargin{:});
Error in HW7_prob1 (line 1)
bpFilt =
designfilt('bandpassfir','PassbandFrequency1',0.4,'PassbandFrequency2',0.5,'StopbandFrequency1',0.3,'StopbandFrequency2',0.6,'PassbandRipple',0.5,'StopbandAttenuation1',50,'StopbandAttenuation2',50,'DesignMethod','Window','hamming');

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!