# Ortogonality prinsiple for noised sine vawes: solving amplitude and phase of sine vawe when frequenc

Discussion in 'MATLAB' started by juho salminen, Oct 6, 2009.

1. ### juho salminenGuest

Hi,

is there any ready functions in matlab which solves amplitudes and phase of sine vawe when frequency is known. For example, in

exercise 24.9. problem 5 uses this method. (Click "Problem set in English" )

Exercise starts as :

You have observed the values x(0); x(1); x(2) from the real-valued sinusoidal signal
x(n) = Asin(nw+a) + v(n); where v(n) is the noise term and a phase. Find the
amplitude A and the phase that minimize the squared error...

juho salminen, Oct 6, 2009

2. ### TideManGuest

No, but you can derive it pretty easily.
First, use trig identities to expand the equation into a sin and cos
Next, go:
help mldivide

BTW, just to be pedantic, it's wave, not vawe.

TideMan, Oct 6, 2009

3. ### Rune AllnorGuest

If there is exactly one sinusoidal with *known* frequency,
use DOT. If there are more sinusoidals amd/or the frequencies
are unknown, things become quite a bit more cumbersome.

Rune

Rune Allnor, Oct 6, 2009
4. ### Miroslav BaldaGuest

If there is only one sampled sinusoidal, you may use the function sinfapm from
http://www.mathworks.com/matlabcentral/fileexchange/19902
even in case that the frequency is not known exactly.
Mira

Miroslav Balda, Oct 6, 2009
5. 