Instananeous frequency of a chirp signal is halved?

  • Thread starter Thread starter Luongo
  • Start date Start date
  • Tags Tags
    Frequency Signal
AI Thread Summary
The discussion revolves around the calculation of instantaneous frequency from a chirp signal using MATLAB. The user initially finds their computed instantaneous frequency to be y = x instead of the expected y = 2x. They suspect an error in their formula for instantaneous frequency, which involves the real and imaginary parts of the signal. Another participant suggests using the analytical signal approach, which correctly yields the expected frequency of 2x. The user resolves their issue by correcting a mistake related to an epsilon factor in their calculations.
Luongo
Messages
119
Reaction score
0
I'm doing some research with MATLAB, where i have a simple chirp. y = sin(x.^2)
i take the FFT of the chirp, set the upper half of the FT of the signal to 0, and take the IFFT of this to recover the original chirp y with real and imaginary parts.
then i use the formula for calculation of the instantaneous frequency:

(s1.*ds2 - s2.*ds1)./(s1.^2 +s2.^2)
where s1 is the real part of y, s2 is imag of y
and ds1 and ds2 are the derivatives of s1 and s2 respectively.

It turns out i get my inst. freq to be y = x. but i expected y = 2x.
Is there any reason why my inst. frequency is missing the factor of 2? I have no idea what I'm doing wrong that results in the missing factor.
thanks!
any help is greatly appreciated.

here is my MATLAB code:
function []=chirp()

x = 0:0.01:5;
y = sin(x.^2);
y = sin(x.^2)-mean(y); %eliminate DC offset subtract mean
plot(x,y,'k')
hold on
y = fft(y);
y = 2*y; %double the amplitude
y(250:end) = 0; %cut off upper half the signal
y = ifft(y);
%double amplitude of the chirp signal
s1 = real(y);
plot(x,s1, 'p')
s2 = imag(y);
%plot(x,s2, 'r')
ds1 = diff(s1)./0.01;
ds1(501) = 0;
ds2 = diff(s2)./0.01;
ds2(501) = 0;
%derivative plots:
%plot(x,ds1,'y');
%plot(x,ds2,'k');
%obtain instantaneous frequency
n = (s1.*ds2 - s2.*ds1);
d = (s1.^2 +s2.^2+ (max(s1).^2));
q = n./d;
plot(x,q, 'g')
 
Physics news on Phys.org
How did you arrive at your formula for the instantaneous frequency? I suspect that it might be off.

If I calculate the instantaneous frequency using a different approach, with the analytical signal 'y' using your code:

dy = diff(y)/0.01;
dy(501) = 0;
instfrq = imag(dy./y);

I get something that tracks 2*x instead. Here I used the imaginary part of the log-derivative of the analytic signal:

\hat{y} = A e^{i\varphi(t)}
\frac{d\hat{y}}{dt}=i \frac{d\phi(t)}{dt} A e^{i\varphi(t)}
\rightarrow \frac{d\phi(t)}{dt} = \frac{\frac{d\hat{y}}{dt}}{i \hat{y}}
 
it turns out i made a mistake with my epsilion correction factor, it works now though. thanks
 
This is from Griffiths' Electrodynamics, 3rd edition, page 352. I am trying to calculate the divergence of the Maxwell stress tensor. The tensor is given as ##T_{ij} =\epsilon_0 (E_iE_j-\frac 1 2 \delta_{ij} E^2)+\frac 1 {\mu_0}(B_iB_j-\frac 1 2 \delta_{ij} B^2)##. To make things easier, I just want to focus on the part with the electrical field, i.e. I want to find the divergence of ##E_{ij}=E_iE_j-\frac 1 2 \delta_{ij}E^2##. In matrix form, this tensor should look like this...
Thread 'Applying the Gauss (1835) formula for force between 2 parallel DC currents'
Please can anyone either:- (1) point me to a derivation of the perpendicular force (Fy) between two very long parallel wires carrying steady currents utilising the formula of Gauss for the force F along the line r between 2 charges? Or alternatively (2) point out where I have gone wrong in my method? I am having problems with calculating the direction and magnitude of the force as expected from modern (Biot-Savart-Maxwell-Lorentz) formula. Here is my method and results so far:- This...

Similar threads

Replies
8
Views
2K
Replies
3
Views
3K
Replies
10
Views
3K
Replies
1
Views
424
Replies
4
Views
3K
Replies
5
Views
3K
Replies
43
Views
6K
Back
Top