Plot phase on FM modulation on time domain

1 次查看(过去 30 天)
I have message signal m(t) which is a data set and i want to find of ∅(𝑡) values after that plot ∅(𝑡) values on time domain. where formula of ∅(𝑡) is ∅(𝑡)=2𝜋50∫𝑚(𝜏)𝑑𝜏.
How i found the m(t) is shown down below.
Fs = 1000; % Sampling frequency
t = -10:1/Fs:10-1/Fs; % Time interval
f = -length(t)/2:1:length(t)/2-1; % Frequcny interval
fc = 250; % Hz
Kf = 50;
Tau = 2; center_1 = 1; center_2 = 3; % Recuired values for creating of "m(t)"
square_wave1 = square_wave_device(Tau, center_1, t); % First square wave
square_wave2 = square_wave_device(Tau, center_2, t); % Second square wave
mt = square_wave1 - square_wave2; % Message Signal
%-------------------- Creating the square waves -----------------------%
function square_output = square_wave_device(T, x, t)
x = x - 1 ; % Calculating the center of the positive side of the wave
square_output = (square((1/2*pi).*(t-x).*(T/2))+1)/2;
end

回答(1 个)

Hassaan
Hassaan 2024-1-8
编辑:Hassaan 2024-1-9
% Sampling frequency and Time interval
Fs = 1000; % Sampling frequency
t = -10:1/Fs:10-1/Fs; % Time interval
% Frequency interval
f = -length(t)/2:1:length(t)/2-1; % Frequency interval
% Required values for creating "m(t)"
Tau = 2; center_1 = 1; center_2 = 3;
% Creating square waves
square_wave1 = square_wave_device(Tau, center_1, t); % First square wave
square_wave2 = square_wave_device(Tau, center_2, t); % Second square wave
% Message Signal m(t)
mt = square_wave1 - square_wave2;
% Plotting m(t)
figure;
plot(t, mt);
title('Message Signal m(t) vs Time');
xlabel('Time (seconds)');
ylabel('m(t)');
grid on;
% Calculating phi(t)
Kf = 50; % Given constant
dt = 1/Fs; % Time step (delta t)
phi_t = 2 * pi * Kf * cumsum(mt) * dt; % Integration of m(t)
% Plotting phi(t)
figure;
plot(t, phi_t);
title('\phi(t) vs Time');
xlabel('Time (seconds)');
ylabel('\phi(t)');
grid on;
% Function for generating square waves
function square_output = square_wave_device(T, x, t)
x = x - 1; % Calculating the center of the positive side of the wave
square_output = (square((1/2*pi).*(t-x).*(T/2))+1)/2;
end
------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
Professional Interests
  • Technical Services and Consulting
  • Embedded Systems | Firmware Developement | Simulations
  • Electrical and Electronics Engineering
  5 个评论
Hassaan
Hassaan 2024-1-10
Yes you can adjust as per your needs.
------------------------------------------------------------------------------------------------------------------------------------------------ If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback. Professional Interests Technical Services and Consulting Embedded Systems | Firmware Developement | Simulations Electrical and Electronics Engineering Feel free to contact me.
Emir Dönmez
Emir Dönmez 2024-1-10
after that how can i integrate the phi value to make FM modulation ?
fc = 250hz, Ac = 5

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Spectral Measurements 的更多信息

产品


版本

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by