remove noise from signal

6 次查看(过去 30 天)
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.

采纳的回答

Star Strider
Star Strider 2022-12-17
编辑:Star Strider 2022-12-17
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 个评论
Võ Trung
Võ Trung 2022-12-18
thank you very much, this help me a lot.
Star Strider
Star Strider 2022-12-18
As always, my pleasure!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Filter Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by