how to design a lowpass filter for a audio signa
6 views (last 30 days)
Show older comments
Hari Ijjada
on 25 Sep 2019
Commented: Star Strider
on 30 Sep 2019
i sent some .wav files as a input to the AM Moudlation scheme in Matlab..i am not getting the clear audio as Output..My Fc=1000,Fs=11025..i attched my input spectrum,the input of the lowpass filter in demodulator spectrum...i know i have some issue in my filter...which filter should i chooose and what is the cutoof frequency i should choose for my filter (you can see the input specturm and get the some knowled3e about the maxmumfrequency of the input )
I got strucked here...so please help me...
0 Comments
Accepted Answer
Star Strider
on 25 Sep 2019
If you have R21018a or later, use the lowpass function. (Also see the links in and at the end of that documentation page.)
It is also easy to design your own filter:
Fs = 11025; % Sampling Frequency
Fn = Fs/2;
Wp = 1000/Fn; % Passband Frequency (Normalised)
Ws = 1010/Fn; % Stopband Frequency (Normalised)
Rp = 1; % Passband Ripple
Rs = 60; % Passband Ripple (Attenuation)
[n,Wp] = ellipord(Wp,Ws,Rp,Rs); % Elliptic Order Calculation
[z,p,k] = ellip(n,Rp,Rs,Wp); % Elliptic Filter Design: Zero-Pole-Gain
[sos,g] = zp2sos(z,p,k); % Second-Order Section For Stability
figure
freqz(sos, 2^16, Fs) % Filter Bode Plot
signal_filt = filtfilt(sos, g, signal); % Filter Signal
4 Comments
Star Strider
on 30 Sep 2019
That is likely not possible. The documentation for filtfilt indicates that x - Input Signal can only be double. The filter function works with integer inputs, however it introduces phase delays and phase distortion. You might be able to work around that by using a linear-phase FIR filter with it such as those produced by fir1. You will have to experiment with that to see if it works with your signal.
More Answers (0)
See Also
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!