フィルターのクリア

Plot phase on FM modulation on time domain

1 回表示 (過去 30 日間)
Emir Dönmez
Emir Dönmez 2024 年 1 月 8 日
コメント済み: Emir Dönmez 2024 年 1 月 10 日
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 Center および File ExchangeSpectral Measurements についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by