removing blink peaks from a signal

조회 수: 12 (최근 30일)
Em123
Em123 2019년 12월 27일
댓글: rami zaboura 2020년 8월 7일
Does anyone know how to program a system to be developed that automatically isolates all the blinks (large peaks) from a signal and saves the cleaned signal to a specific variable. And then how to plot the signal before and after blink isolation alongside with their spectrum (before/after) and save the spectrums to specific variables.
Thank you

답변 (1개)

Deepak Kumar
Deepak Kumar 2019년 12월 31일
You can use "findpeaks" function in MATLAB to final the local maxima (peaks) of the input signal vector. The below documentation link gives the detailed description about "findpeaks" function.
The below example code snippet extracts the peak from the signal and plot them before and after peak extraction. In the code I have extracted the peaks from the signal and subtracted it from the original signal. So the peak values are now replaced by zeros.
fs=1000; %Sampling frequency
t=0:1/fs:1; %time vector
y=10*sin(2*pi*10*t); % Input Signal
figure(1)
plot(t,y) % Plot the signal before peak extraction
[pks,locs] = findpeaks(y); % returns a vector with the local maxima (peaks) of the input signal y and the indices at which the peaks occur.
x=zeros(size(y));
x(locs)=y(locs);
z=y-x; %Cleaned Signal
figure(2)
plot(t,z) % Plot the signal after peak extraction
You can use "FFT" function in MATLAB to find the spectrum of the signal. The below is the documenation link for the "FFT" function.
  댓글 수: 1
rami zaboura
rami zaboura 2020년 8월 7일
can anyone approve this answer?

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

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by