How can I draw the mt sign? Frequency Modulation

The message signal ๐‘š(๐‘ก)=โˆ((๐‘กโˆ’1)/2))โˆ’โˆ(๐‘กโˆ’3)/2),
How can I draw the mt sign?
The message signal ๐‘š(๐‘ก)=โˆ((๐‘กโˆ’1)/2))โˆ’โˆ(๐‘กโˆ’3)/2), c(๐‘ก) = 5๐ถ๐‘œ๐‘ (500๐œ‹๐‘ก) to obtain FM signal ๐‘ฆ(๐‘ก) = 5๐ถ๐‘œ๐‘ (500๐œ‹๐‘ก + โˆ…(๐‘ก)), where โˆ…(๐‘ก) = 2๐œ‹๐‘˜๐‘“ โˆซ ๐‘š(๐œ)๐‘‘๐œ with ๐‘˜๐‘“ = 50. The demodulator consists of a differentiator, a diode (assume ideal), a low pass filter (LPF) and a capacitor for DC blocking, successively. 1) Plot the message signal. Obtain and plot the magnitude spectrum of the message signal. 2) Obtain and plot the time-domain representation and magnitude spectrum of the phase โˆ…(๐‘ก). 3) Obtain and plot the time-domain representation and magnitude spectrum of the modulated signal ๐‘ฆ(๐‘ก).

Answers (1)

% Parameters
fs = 8000; % Sampling frequency for decent visualization
t = 0:1/fs:5; % Time vector from 0 to 5 seconds
f_c = 500; % Carrier frequency
k_f = 50; % Frequency sensitivity
% Create the message signal
message = message_signal(t);
% Carrier signal
carrier = cos(2 * pi * f_c * t);
% Frequency Modulate the carrier with the message
integral_message = cumtrapz(t, message); % Integrate message signal with respect to time
fm_signal = cos(2 * pi * f_c * t + k_f * integral_message); % FM signal
% Plot the message signal
figure;
subplot(2, 1, 1);
plot(t, message);
title('Message Signal m(t)');
xlabel('Time [s]');
ylabel('Amplitude');
% Plot the magnitude spectrum of the message signal
subplot(2, 1, 2);
fft_message = fft(message);
fft_freq = linspace(-fs/2, fs/2, length(message));
plot(fft_freq, fftshift(abs(fft_message)));
title('Magnitude Spectrum of Message Signal m(t)');
xlabel('Frequency [Hz]');
ylabel('Magnitude');
% Plot the modulated signal y(t) and its magnitude spectrum
figure;
% Time domain representation of modulated signal y(t)
subplot(3, 1, 1);
plot(t, fm_signal);
title('Time-domain Representation of Modulated Signal y(t)');
xlabel('Time [s]');
ylabel('Amplitude');
% Magnitude spectrum of modulated signal y(t)
subplot(3, 1, 2);
fft_fm = fft(fm_signal);
plot(fft_freq, fftshift(abs(fft_fm)));
title('Magnitude Spectrum of Modulated Signal y(t)');
xlabel('Frequency [Hz]');
ylabel('Magnitude');
% Phase spectrum of modulated signal y(t)
subplot(3, 1, 3);
phase_fm = angle(fft_fm);
plot(fft_freq, fftshift(phase_fm));
title('Phase Spectrum of Modulated Signal y(t)');
xlabel('Frequency [Hz]');
ylabel('Phase [Radians]');
% Define the message signal m(t)
function mt = message_signal(t)
mt = (t - (1/2)).^2 .* (sinc(t - (1/2))).^2 - (t - (3/2)).^2 .* (sinc(t - (3/2))).^2;
end
Please note that MATLAB's sinc function is normalized differently from the mathematical definition of sinc used in signal processing. MATLAB defines sinc(x) = sin(pi*x)/(pi*x), while the standard signal processing definition is sinc(x) = sin(x)/x. If you need the unnormalized version, you should replace sinc(t - (1/2)) with sin(pi*(t - (1/2)))/(pi*(t - (1/2))) and similarly for the other terms.
---------------------------------------------------------------------------------------------------------------------------------------------------
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.

Categories

Asked:

on 10 Jan 2024

Answered:

on 10 Jan 2024

Community Treasure Hunt

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

Start Hunting!