Created
July 19, 2020 13:52
-
-
Save sritasngh/ffd5130e06f008d11086a46672c195fa to your computer and use it in GitHub Desktop.
Write a code in MATLAB to obtain Hilbert transform of the signal x(t)=5 cos(2 π 300t), obtain the analytic signal and plot its amplitude with time, and phase with time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%Hilbert function | |
F = 10000; %sampling frequency(Hz) | |
t = 0:1/F:0.05; %time vector | |
x= 5*cos(2*pi*300*t); %given signal | |
x_h=hilbert(x); % Hilbert function of x(t) | |
figure(1); | |
plot(t,real(x_h),t,imag(y)); | |
%Plot real and imaginary part of Hilbert function | |
xlabel('t(sec)'); ylabel('X_h(t)'); | |
legend('real','imaginary'); | |
title('Hilbert Function'); | |
figure(2); | |
plot(t,abs(x_h));% plot absolute value of Hilbert function | |
title('Magnitude Vs Time'); | |
figure(3); | |
plot(t,angle(x_h));% plot angle of Hilbert function | |
title('Phase Vs Time'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment