I am trying to calculate amplitude and frequency modulation, as well as phase, of a sinusoidal function.
The function is decribed as follows:
fs = 128;
x1 = 1/fs:1/fs:1;
A1 = 50*x1;
B1 = 10*x1;
C1 = 1;
D1 = 1;
y1 = D1 + A1.*sin(C1 + B1.*x1);
As a result I have obtained a sinusoidal function. It's amplitude and frequency increase over time, and are dependant on time. I need to use only 128 samples, so sampling frequency was changed to 128Hz.
Now, assuming I do NOT know A1, B1, C1 or D1 parameters, and only know the sampling frequency and result of "y1", is it possible to calculate all of those parameters?
What I would like, is to be able to determine frequency, amplitude and shift of the function at any given point in time.
I know that it's possible to calculate all of those for a function with stable parameters in few ways, I personally have tried this:
zastep2 = 1 + 40.*sin(1 + 10.*x1);
x = x1';
y = zastep2';
calc = @(d) [ones(size(x)),sin(d*x),cos(d*x)]\y;
calc2 = @(d) sum((y-[ones(size(x)),sin(d*x),cos(d*x)]*calc(d)).^2);
Bw = fminbnd(calc2,1,50)
abb = calc(Bw);
Dw = abb(1)
Aw = norm(abb([2 3]))
Cw = acos(abb(2)/Aw)
"zastep2" is used to simulate a function with unchanging parameters. As a result, I get the values of Dw = 1, Cw = 1, Aw = 40 and Bw = 10, so everything is okay.
Problem is, my function's amplitude and frequency linerary increase in every step, so using this kind of solution is impossible.
Is there any way to calculate those if both frequency and amplitude increase in every step? I am of course not asking for an instant solution or complete code, but I am really stuck on this, and after searching in the Internet for quite a while, decided to ask my own question.