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

3 visualizzazioni (ultimi 30 giorni)
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
plot(t,x)
grid on
xlabel('Time (s)')
ylabel('Amplt')
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');
ylabel('Amplitude');
%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);
plot(t,y)
grid on
xlabel('Time (s)')
ylabel('Amplt')
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.
% MATLAB Code
% 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);
end
  6 Commenti
Star Strider
Star Strider il 25 Apr 2022
The signal energy in the stopband can never be entirely eliminated. The purpose of the filter is to force the energy in the stopband to be a low as practically attainable, usually -50 to -75 dB. (Filters of all types can have stability problems or not be able to be realised if the stopband requires extreme values of attenuation and the transition region is relatively short.)
So the filter you designed is doing exactly what it is supposed to do. It needs no changes. I would just use it as it is.
Vishal Sathiaseelan
Vishal Sathiaseelan il 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.

Accedi per commentare.

Risposte (0)

Prodotti


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by