Parameters Setting - Signal.: Clear Close CLC
Parameters Setting - Signal.: Clear Close CLC
Parameters Setting - Signal.: Clear Close CLC
........................................................................................................................................ 1
PARAMETERS SETTING - SIGNAL. ................................................................................... 1
PARAMETERS SETTING - SAMPLING. .............................................................................. 1
AXIS GENERATION - RANGE TIME. ................................................................................. 1
AXIS GENERATION - RANGE FREQUENCY. ..................................................................... 1
SIGNAL GENERATION - FFT. ........................................................................................... 1
SIGNAL GENERATION - PRINCIPLE OF STATIONARY PHASE (POSP). ............................... 2
PLOTTING - LINEAR FM SIGNAL. .................................................................................... 2
clear all;
close all;
clc;
%
1
Phi = pi*K*t.^2; %Istantaneous phase.
Frq = K*t; %Istantaneous frequency.
s = A*exp(+1i*Phi); %Chirp signal.
S = fft(s, NoFT);
S = fftshift(S);
%
2
ylabel('Frequency [Hz]');
title('Istantaneous frequency of signal');
%
%
M = ceil(max(10*log10(abs(S)))) + 3;
figure;
subplot(2, 2, 1);
plot(f, 10*log10(abs(S)));
grid on;
xlim([f(1) f(end)]);
ylim([M-20 M]);
xlabel('Frequency [Hz]');
ylabel('Amplitude');
title('Magnitude of spectrum - DFT');
%
subplot(2, 2, 2);
plot(f, angle(S));
grid on;
xlim([f(1) f(end)]);
xlabel('Frequency [Hz]');
ylabel('Angle [rad]');
title('Phase of spectrum - DFT');
%
subplot(2, 2, 3);
plot(f, 10*log10(abs(Fs*S_POSP)));
grid on;
xlim([f(1) f(end)]);
ylim([M-20 M]);
xlabel('Frequency [Hz]');
ylabel('Amplitude');
title('Magnitude of spectrum - POSP');
%
subplot(2, 2, 4);
plot(f, angle(S_POSP));
grid on;
xlim([f(1) f(end)]);
xlabel('Frequency [Hz]');
ylabel('Angle [rad]');
title('Phase of spectrum - POSP');
%
%
figure;
plot(f, angle(S));
grid on;
hold on;
plot(f, angle(S_POSP), 'r');
%% There is no matching between POSP's phase and theoretical
phase.
xlim([f(1) f(end)]);
xlabel('Frequency [Hz]');
ylabel('Angle [rad]');
legend('FFT', 'POSP');
title('Phase of spectrum');
%
3
Out = S.*conj(S_POSP);
%
figure;
subplot(2, 1, 1);
plot(f, angle(Out));
grid on;
xlabel('Frequency [Hz]');
ylabel('Angle [rad]');
subplot(2, 1, 2);
plot(f(1:(end-1)), diff(angle(Out)), '.');
grid on;
xlabel('Frequency [Hz]');
ylabel('Diff [rad]');
%
4
5
Published with MATLAB® R2016a