Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Filtering of audio signal
Replies: 1   Last Post: Dec 27, 2013 7:33 AM

 Messages: [ Previous | Next ]
 Nasser Abbasi Posts: 6,677 Registered: 2/7/05
Re: Filtering of audio signal
Posted: Dec 27, 2013 7:33 AM

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:

wp=2*pi*fp/Fs;
ws=2*pi*fs/Fs;

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