After y = filter(d , x), y is exactly the same as x. Please help filter function NOT working.

6 views (last 30 days)
I am doing a typical Noise Filtering DSP Project. I have done an Elliptic IIR LowPass Filter using filterDesigner. When i use y = filter(d,x), the output y is the same as x. No difference at all. why is the filter function not working ?
[x, Fs] = audioread("vuvuzela.mp3"); %read audio in vector x with Fs
N = length(x);
t = (0:N-1)/Fs; % time domain range for audio
duration = N/Fs % duration of audio is 97.8370 seconds
% Plot time-domain
grid on
xlabel('Time (s)')
title('Signal in time-domain')
% Periodogram Power Spectrum shows power for each frequency
w = hanning(N, 'periodic'); % Periodic Hann Window with N samples
periodogram(x, w, N, Fs,'power')
%Compute FFT freq domain
Freq = (0:N-1).*(Fs/N); % Frequency axis Freq = Fs/N [Hz] of audio signal x
Xk = fft(x,N); % FFT audio signal
Real_Xk = abs(Xk); % FFT can give complex values. we just want magnitude
plot(Freq, Real_Xk);
title('Freq Domain Plot of Audio Signal');
xlabel('Frequency, Hz');
%Denoise using Filter. Look at Periodogram Power Spectrum Estimate
%at 11kHz is cut-off freq btwn message signal & noise signal
%Denoise the x audio signal using Filter
%Create filter using >>filterDesigner
d = EllipIIRlowpass;
y = filter(d,x);
grid on
xlabel('Time (s)')
title('Filtered Signal in time-domain')
periodogram(y, w, N, Fs,'power')
%sound(y, Fs);
function Hd = EllipIIRlowpass
%ELLIPIIRLOWPASS Returns a discrete-time filter object.
% Generated by MATLAB(R) 9.11 and Signal Processing Toolbox 8.7.
% Generated on: 25-Apr-2022 01:09:50
% Elliptic Lowpass filter designed using FDESIGN.LOWPASS.
% All frequency values are in Hz.
Fs = 48000; % Sampling Frequency
Fpass = 11000; % Passband Frequency
Fstop = 11500; % Stopband Frequency
Apass = 10; % Passband Ripple (dB)
Astop = 80; % Stopband Attenuation (dB)
match = 'passband'; % Band to match exactly
% Construct an FDESIGN object and call its ELLIP method.
h = fdesign.lowpass(Fpass, Fstop, Apass, Astop, Fs);
Hd = design(h, 'ellip', 'MatchExactly', match);
Vishal Sathiaseelan
Vishal Sathiaseelan on 25 Apr 2022
Noted. Thank you very much for quick reply and helpful advice. I will try out better filter design specifications to filter out the noise.

Sign in to comment.

Answers (0)




Community Treasure Hunt

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

Start Hunting!