Plot phase on FM modulation on time domain

1 view (last 30 days)
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

Answers (1)

Hassaan
Hassaan on 8 Jan 2024
Edited: Hassaan on 9 Jan 2024
% 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 Comments
Hassaan
Hassaan on 10 Jan 2024
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 on 10 Jan 2024
after that how can i integrate the phi value to make FM modulation ?
fc = 250hz, Ac = 5

Sign in to comment.

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!