Hi, I would like to ask a few questions:
- How to set 20% upper and lower threshold from the signal maximum amplitude and make a line of the thresholds.
- From the upper threshold line, how to find and mark the 1st line intersection between upper threshold and signal.
- How to expand the signal that only focus on the line intersection automatically.
I really appreciate if anyone can help me with matlab coding.
load energy_bigcircle_placement1 %load file
[p,s,mu]=polyfit((1:numel(bigcircle_ant2))',bigcircle_ant2,20);f_y=polyval(p,(1:numel(bigcircle_ant2))',[],mu);bigcircle_ant2_data=bigcircle_ant2 - f_y;tms=(0:numel(bigcircle_ant2_data)-1)/Fs;figure (1)plot(tms,bigcircle_ant2_data) axis tighttitle('Signal and Scalogram')xlabel('Time(s)')ylabel('Amplitude')grid on
Regards.
Best Answer