extract bands from spectrogram to measure frequency excursions
5 views (last 30 days)
I would like to measure the length of frequency excursions from spectrogram chirp data.
here is my spectrogram.
[spec,f,t]=spectrogram(seg,hanning(nfft),overlap,nfft,Fs,'yaxis'); %with seg = segment of data analyzed
I have the x coordinates of the chirps (x_peaks) and I would like to measure the length of the peaks. I have already tried to sum the spectrogram frequencies in a range (using "find" and "sum"). However in case of interferring signals like in my case (there are two main freq signals, only one has peaks) this would give an incorrect measure of the real chirps because it will include the power of the "passing by" signal. What I thought to do was to find in the spectrogram the columns corresponding to the x values of the peaks, extract the y values in a certain range (for example +50 and +300 higher than the main frequency component; "frange") and then do further peak detection on those, with the assumption that finding a minimum in each of such column would find the end of the chirp, if the range is set properly.
this is my code
chirprange2 = (x_peaks,spec[frange,:]);
x_peaks are the x values of the chirps, spec is the spectrogram, frange is the frequency band of spec in which the chirps are located. It has been previously calculated as
frange2 = find(f2>(EOD2f+50) & f2<(EOD2f+300));
what I get it the following error: Error: File: chirprange_amplitude.m Line: 1 Column: 24 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters. It is not clear to me where the problem is as I am using a similar syntax as before but this time it doesn't work. thanks for any feedback !