I have a signal in matlab that I want to:
2) pass through a low pass filter
3) count the "waves" (valleys and peaks) of the signal
[url removed, login to view] frequency
b.Cut-off frequency for low-pass filtering
[url removed, login to view] values for detection of waves:
minimum amplitude of wave
minimum width of wave
maximum slope of wave
a. frequency of waves detected
b. mean amplitude of waves detected
c. mean slope of waves detected
I don't need a GUI, a .m file is enough. The waves in the signal are composed mostly from a valley followed by a peak. Sometimes a peak alone shows up in the signal and that should be counted measured too. I attach a sample of a signal to be analyzed. This is a description from a medical journal that describes the program:
> The program recorded and counted the number of waves per second, by defining the valleys and peaks, and calculated the mean of the amplitudes of the waves and the mean basal level in the studied period for the spontaneous skin conductance activity. The valleys and peaks were established when the derivate of the wave was 0. The amplitude of the wave was calculated from the bottom of the valley prior to the peak to the height of the peak. The slope was defined as the mean distance valley to the peak/time to reach peak. The width of the wave defined the number of measured data points following directly after a valley, to be used in the analysis of the wave. Broad widths can reduce the apparent amplitude of peaks and alter the apparent location. The program is based on an algorithm that fits a quadratic polynomial to sequential groups of datapoints. The number of data points used in the fit was specified by width. For each peak or valley, the quadratic fit was tested against the threshold level: peaks with heights below threshold or valleys with troughs above threshold are ignored.
> The program contained a function that enabled us change these values, and we used this to try out different pre-set values for the minimum amplitude, maximum slope and minimum width of the waves. The results using the preset values were compared to the manual counting. The software analysis program could also analyze smaller segments of the registered data. This function was used if artefacts were found. Moreover, in order to examine details of the registered data, a particular time period during registration could be chosen and expanded. This function was used during manual counting of the number of waves.