Removing noise from a signal

조회 수: 192 (최근 30일)
MINA
MINA 2016년 9월 20일
댓글: Star Strider 2021년 4월 7일
I have a following signal, and I want to correct the part which has a sharp jump, based on the value of the signal sometimes before the jump and its future values.
Instead of that jump I want something like a red line or green line, or something in between (sth that is most likely to be the signal instead of that noise based on the behavior of the signal in the pas and in the future.) Any suggestions?

답변 (2개)

Image Analyst
Image Analyst 2016년 9월 20일
You can use a modified median filter. Basically compute the median. Then find any points where the actual signal is some factor higher than the median signal. Replace those points with the median. Something like
medianSignal = medfilt1(signal, 5); % Smooth signal
badIndexes = abs(signal-medianSignal) > someValue; % Find bad ones
signal(badIndexes) = medianSignal(badIndexes); % Repair signal
  댓글 수: 6
Chappi
Chappi 2020년 2월 11일
aahhh. I want to try out your suggestion but I dont have signal processing toolbox. Would you please recommend sth else silimar with medfilt ? THank you
Christine Tobler
Christine Tobler 2020년 2월 11일
The function smoothdata in basic MATLAB (introduced in R2017a) has a median filter.

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


Star Strider
Star Strider 2016년 9월 20일
The ‘spike’ creates broadband, high-frequency noise. I would first do a fft of your signal to understand the frequency composition, then design a lowpass or bandpass filter to keep your frequencies of interest, and use it to filter your signal.
There are many ways to design filters in MATLAB, probably the easiest being designfilt. My IIR filter design procedure is outlined in: How to design a lowpass filter for ocean wave data in Matlab? Remember to do the actual filtering with the filtfilt function.
  댓글 수: 2
632541
632541 2021년 4월 7일
Can i use built in function for LPF in matlab instead of designfilt or filtfilt
Star Strider
Star Strider 2021년 4월 7일
I would use the lowpass function (introduced in R2018a) if you have it. Otherwise, designing the filter from command-line functions is the only option.

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

카테고리

Help CenterFile Exchange에서 Single-Rate Filters에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by