Detecting and saving the values of a single pulse signal form the continuous incoming pulses signals

8 views (last 30 days)
Hello, I am getting data of pulse signals into matlab through serial port.I want to detect and distinguish each pulse pulse signal and want to save the data(all the samples of amplitude that can reconstruct the signal for the later use) of the pulse signals.
As all pulse signals don't have the same number of samples it is impractical to assume that a particular 'x' samples(values) makes a pulse signal.So, I need a method that can detect/distinguish each pulse signal depending on some parameters and save each pulse signal data.
The incoming pulse signals looks like the below

Answers (2)

Image Analyst
Image Analyst on 29 Dec 2013
Use findpeaks() in the Signal Processing Toolbox, or this http://www.mathworks.com/matlabcentral/fileexchange/25500-peakfinder
  1 Comment
Gova ReDDy
Gova ReDDy on 5 Jan 2014
Edited: Gova ReDDy on 5 Jan 2014
Yes,the peaks of pulse signals are found using the function from above link.
But in realtime each time 500 samples(each collected at 2ms(500Hz) at microcontroller) will be sent to matlab respresenting 1 sec duration of pulse signal.So,in the below image we can see that out of 500 samples only around 412 values represent a pulse so these 412 values should be saved into some variable say P1 and the remaining 88 values should be added to the length of P2 next consecutive pulse signal detected. In this the first four pulse signals are to be saved in some variables so that they can be used to average with the currently detected pulse signal.
Can I know how to implement this or can you suggest any other idea to implement this kind of periodic moving average.

Sign in to comment.


Gova ReDDy
Gova ReDDy on 9 Jan 2014
Edited: Gova ReDDy on 9 Jan 2014
I just improved the analog circuitry such that the output pulse signal(sampled at 500Hz) has a minimum value of zero whereas the previous circuit was resulting the pulse signal shown above where the minimum value was varying a lot.
Can someone suggest a method to divide this incoming pulse signal into periods such that each period contains a pulse signal.I also guess that each divided period(of pulse signal)doesn't contains same samples for which afterwards the interpolation will be used for fitting the samples between them.
I am not sure of what parameters can be used to distinguish and divide each pulse signal.
  7 Comments
Gova ReDDy
Gova ReDDy on 10 Jan 2014
Edited: Gova ReDDy on 10 Jan 2014
yes,it is working perfectly and is making the pulse signal into square signal.
But can I know how to
find the starting index(where the amplitude >some x value say 0.08) of one hump and save the values(amplitudes) in a variable untill it encounters another starting index of next hump(again when the amplitude exceeds 0.08) for every incoming 500 samples. as sometimes the 500 samples will have two half pulse signals as shown in my last post image.How to add the last half samples(in last 500 samples) of pulse signal to the current half samples to make it full pulse. Also how to save the first detected 4 pulse signals into some variables so that I will use this for averaging the currently detected pulse signal.
The signal data is attached.I hope you will unfold this implementation.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!