Azzera filtri
Azzera filtri

removing blink peaks from a signal

5 visualizzazioni (ultimi 30 giorni)
Em123
Em123 il 27 Dic 2019
Commentato: rami zaboura il 7 Ago 2020
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

Risposte (1)

Deepak Kumar
Deepak Kumar il 31 Dic 2019
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.

Prodotti


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by