Why does frequency of complex exponential doubles when frequency increases?
Afficher commentaires plus anciens
Hello,
Let me first give the general context. I am currently on a code to generate and detect the frequency shift generated by the Doppler effect of a moving object. So my basic idea was to generate a baseband complex signal emitted by the moving object
, and then multiply it by a complex exponential of which the phase corresponds to the frequency shift
of the doppler effect, such that the resulting frequency-shifted signal y is:
Now, since the object is moving,
is a function of time and changes for each signal sample, so the correct equation would be:
This brings me to my current issue. I have a code that generates the complex exponential in charge of the phase shift based on a vector containing the doppler shift frequencies for each signal sample. To make it simple, the frequency shifts increase linearly from 0 to 100 Hz. But when I plot the sprecturm of the obtained complex exponential
, the sectrum spans up to 200 Hz.
I cannot figure out if this is due to me no understanding the math properly, a code error, or a Matlab issue.
Note that if I change the doppler shift frequency to contain a constant value, e.g. 50Hz, then the spectrum displays a spike at 50 Hy, as expected.
Please find below the code to reproduce my issue:
F = 1e6; % Symbol rate
Fs = F * 4; % Sampling frequency
Ts = 1 / Fs; % Sampling period
n_samples = 4000000;
time = (0:n_samples-1) * Ts; % Time vector
doppler_shift = 50.*ones(1,length(time));
phase_rotation = exp(1j * 2 * pi * doppler_shift .* time).'; % Complex signal
Y = fft(phase_rotation, 2^(1 + ceil(log2(Fs)))); % FFT
P2 = abs(Y);
L = length(P2);
P1 = abs(fftshift(Y)); % Shifted FFT
f = Fs / L * (-L/2:L/2-1); % Frequency vector
% Plotting the spectrum
figure;
plot(f, P1); % Spectrum plot
xlabel('Frequency (Hz)');
ylabel('Magnitude');
title('Constant Doppler shift');
xlim([0 2*max(doppler_shift)])
doppler_shift = 100 * (1:length(time)) / length(time); % Frequency array
phase_rotation = exp(1j * 2 * pi * doppler_shift .* time).'; % Complex signal
Y = fft(phase_rotation, 2^(1 + ceil(log2(Fs)))); % FFT
P2 = abs(Y);
L = length(P2);
P1 = abs(fftshift(Y)); % Shifted FFT
f = Fs / L * (-L/2:L/2-1); % Frequency vector
% Plotting the spectrum
figure;
plot(f, P1); % Spectrum plot
xlabel('Frequency (Hz)');
ylabel('Magnitude');
title('Variable Doppler shift');
xlim([0 2*max(doppler_shift)])
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Detection, Range and Doppler Estimation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




