How to remove noise from the noisy signal

조회 수: 26 (최근 30일)
Rupa Sarkar
Rupa Sarkar 2019년 7월 18일
답변: Vinai Datta Thatiparthi 2019년 7월 29일
Hi, I am new to the MATLAB community. I have to remove noise from a signal. I followed a previous post and changed my signal to frequency. However, I don't know how to use ifft and filters properly. My excel spreadsheet is attached here. Any help will be grately appreciated. Thank you.
function [ output_args ] = Fourier4( )
[D, S] = xlsread('file2.xlsx');
t = D(:,1);
EKG = D(:,2);
figure
plot(t, EKG)
L = numel(t);
tr = linspace(min(t), max(t), L);
EKGr = resample(EKG, tr);
Ts = mean(diff(t));
Fs = 1/Ts;
Fn = Fs/2;
MeanV = mean(EKGr);
FT_EKG = fft(EKGr-MeanV)/L;
Fv = linspace(0, 1, fix(L/2)+1)*Fn;
Iv = 1:numel(Fv);
figure
plot(tr, EKGr)
FT_EKGA = abs(FT_EKG(Iv));
figure
plot(Fv,FT_EKGA)
xlabel('Frequency (Hz)')
ylabel('Amplitude (mV)')
Y = ifft(FT_EKGA);
figure
Plot (tr, abs (Y))
end
  댓글 수: 1
Jan
Jan 2019년 7월 19일
Before you can filter the noise, you have to define, what the noise is. Maybe you are interested in the low frequency signal, or in the high frequencies. We cannot guess, what "properly" means in your case.

댓글을 달려면 로그인하십시오.

답변 (1개)

Vinai Datta Thatiparthi
Vinai Datta Thatiparthi 2019년 7월 29일
Hi Rupa!
To begin with, I’d prefer using the command readtable instead of xlsread, since the former is the recommended command now. You can split the data accordingly using –
data = readtable('file2.xlsx');
t = table2array(data(:,1));
EKG = table2array(data(:,2));
Further, after you convert the signal into frequency domain using fft, MATLAB provides a wide range of functions as part of the Signal Processing Toolbox that can help you remove the noise. One of the easier functions to start with could be fir1 which allows you to design filters based on the different parameter details that you provide. You may use the function filter to apply the filter you created to the signal of your choice. Refer to this link for the necessary documentation –
As an addition, consider using the Filter Designer App in MATLAB. The documentation is at –
This detailed article contains multiple examples of filtering signals –

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by