필터 지우기
필터 지우기

remove noise from signal

조회 수: 6 (최근 30일)
Võ Trung
Võ Trung 2022년 12월 17일
댓글: Star Strider 2022년 12월 18일
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