Info

This question is closed. Reopen it to edit or answer.

summing the ith frequencies with the ith amplitudes^2 from a spectrogram of a Harmonic

1 view (last 30 days)
From http://i.imgur.com/Arctu.png where fi is the ith frequency component, ui is the amplitude of said frequency component, K is a constant, tau is time and t is the time integration variable I have used the following to spectrogram a harmonic that will be processed by the attached eqn:
[S, F, T, P] = spectrogram(A(800000:6*800000), 2^15, 1, (1:0.1:20)*10^4, 1/1.2e-7)
I don't have any problems with the first half of the eqn in the link, but the second half confuses me. You can't square a vector and I'm not certain that amplitude is P, or if frequency is taken from S or F. Would you take the peaks in the amplitude vector or take it time segment by time segment?
I appreciate any help.

Answers (2)

Matt Fig
Matt Fig on 23 Apr 2011
It is not the vector that is being squared, but each component.
A = [1 2 3 4];
A.^2 % Notice the '.' - it matters!
%
%
%
EDIT In response to your 'answer' below.
I don't know which variables form spectrogram you should be using. It is up to you to understand the problem and your particular application. For example, I don't know where you got those equations you posted, only you know that. Perhaps reading the SPECTROGRAM doc will help.

Gareth
Gareth on 23 Apr 2011
Ok, but which variables from spectrogram should I be using?

Community Treasure Hunt

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

Start Hunting!