On 12/27/2013 4:32 AM, Djordje wrote: > Hello everybody, > > I have some question, think you can help. > I have this code that I use for filtering some audio samples. I did it >well in older versions of Matlab, but in the new versions I have this error message: > > Error using buttord (line 64) > The cutoff frequencies must be within the interval of (0,1). > > I tried everything but unsuccessfuly...The code is: > > Ts=1/Fs; > fp=f1/2-500; > wp=2*pi*fp; > fs=f1-1300; > ws=2*pi*fs; > rp=1; > rs=90; > > [N, wn] = buttord(wp, ws, rp, rs); > [bnum, bden] = butter(N, wn); > [numd, dend] = impinvar(bnum, bden, 1/Ts); > > f1 and f2 are the frequencies from audio signal. And once again, it did well in >older version of Matlab, but in new one (2012) I get this error... >
Try doing it this way:
Where fp is the passband freq in Hz, and fs is stopband in Hz, and Fs is Sampling frequency in Hz.
You did not give what values you used for your f1 and Fs and so one can't help you more. cut-off frequencies has to be in 0,1 range offocurse.