MATLAB Answers

Chris Martin
0

How to find annual amplitude and phase of time series

Asked by Chris Martin
on 19 Jul 2013

How to find annual amplitude and phase of time series

  0 Comments

Products

No products are associated with this question.

1 Answer

Answer by Wayne King
on 19 Jul 2013
 Accepted answer

There are a number of ways you can try and estimate it. Do you have a priori knowledge of the frequency? If so you can use linear regression to find the amplitude and phase.

For example, assume I know the frequency is 10 Hz for data sampled at 100 Hz.

    Fs = 100;
    t = 0:1/Fs:2-1/Fs;
    x = 1.5*cos(2*pi*10*t-pi/4)+randn(size(t));
    % create the design matrix
    X = ones(length(x),3);
    X(:,2) = sin(2*pi*10*t);
    X(:,3) = cos(2*pi*10*t);
    x = x(:);
    beta = X\x;

The amplitude estimate is:

   amp_est = norm([beta(2) beta(3)],2)

The phase angle estimate is:

   phase_est = atan2(-beta(2),beta(3))

If you don't know the frequency a priori, then look at the following example:

https://www.mathworks.com/help/signal/ug/frequency-domain-linear-regression.html

  2 Comments

Frequency is one cycle per year

Wayne King
on 2 Aug 2013

Then you should be able to use method I give you above.


Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!