Filter löschen
Filter löschen

remove noise from signal

6 Ansichten (letzte 30 Tage)
Võ Trung
Võ Trung am 17 Dez. 2022
Kommentiert: Star Strider am 18 Dez. 2022
Guys, im doing an assignment that design a lowpass butterworth filter to get filter order, draw magnitude, pole zero plot, impulse remove noise from noisy file. I have some difficulty
  1. I need to get magnitude start from 40db but i try to multiply k with 100 but nothing change
  2. After filtered, i get no signal
Please explain to me, thank you.
I attached my code and noisy file.

Akzeptierte Antwort

Star Strider
Star Strider am 17 Dez. 2022
Bearbeitet: Star Strider am 17 Dez. 2022
Change:
[b,a] = butter(n,Wn);
to:
[z,p,k] = butter(n,Wn);
and eliminate the tf2zp call.
Then the filtfilt call should be:
filtered_signal = filtfilt(sos,g, noisy);
See the documentation on the zplane function for details on how to use it. Use the ‘sos’ output as the argument for zplane and impz.
I have no idea what ‘I need to get magnitude start from 40db’ means. Note that ‘Rp’ (passband ripple or magnitude) and ‘Rs’ (stopband ripple or magnitude) are defined in terms of dB, so change them to do what you want.
Testing the signal —
LD = load(websave('bai2','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1234397/bai2.mat'))
LD = struct with fields:
fs: 44100 noisy: [150437×1 double]
noisy = LD.noisy;
Fs = LD.fs;
L = numel(noisy);
t = linspace(0, L-1, L)/Fs;
filtered_signal = lowpass(noisy, 2500, Fs, 'ImpulseResponse','iir');
figure
subplot(2,1,1)
plot(t, noisy)
grid
subplot(2,1,2)
plot(t, filtered_signal)
grid
ylim([-1 1]*0.015)
The filtered signal (here the output of an elliptic lowpass filter simply to be certain that there was something left after filtering it) has a very small amplitude, so plot it separately as I did here in order to see it. Your result should look something like this result.
EDIT — (17 Dec 2022 at 15:24)
Minor corrections.
.
  2 Kommentare
Võ Trung
Võ Trung am 18 Dez. 2022
thank you very much, this help me a lot.
Star Strider
Star Strider am 18 Dez. 2022
As always, my pleasure!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by