Create FM signal 100 MHz

4 vues (au cours des 30 derniers jours)
Alexandro Lopess
Alexandro Lopess le 1 Jan 2020
Modifié(e) : Amish le 13 Fév 2025
I need to create a FM signal 100 MHz from a segment of a song and
then do frequency modulation such that the modulated signal has a
bandwidth of about 100kHz. Please help me. Thanks so much.

Réponses (1)

Amish
Amish le 13 Fév 2025
Modifié(e) : Amish le 13 Fév 2025
Hi Alexandro,
You can try to create an FM signal from a segment of a song and ensure the modulated signal has a bandwidth of about 100 kHz using certain Signal Processing Tools. This This will involve reading the audio file, performing frequency modulation, and then analyzing the bandwidth.
Refer to the below code that tries to implement a basic version of the same (I have added some comments to help explain it better):
[audio, fs] = audioread('your_song_segment.wav');
% Select a segment of the song (Eg.: first 5 seconds)
segmentDuration = 5; % seconds
audioSegment = audio(1:segmentDuration*fs);
% Preprocess the audio
% Downsample if needed (ensure audio fits within the bandwidth)
desiredFs = 44100; % Desired sampling frequency
audioSegment = resample(audioSegment, desiredFs, fs);
% Parameters for FM
fc = 100e6; % Carrier frequency (100 MHz)
kf = 50; % Frequency sensitivity
t = (0:length(audioSegment)-1) / desiredFs;
% You may need to adjust kf to achieve the desired bandwidth
% Perform frequency modulation
% Integrate the audio signal to get phase
integratedAudio = cumsum(audioSegment) / desiredFs;
fmSignal = cos(2*pi*fc*t + 2*pi*kf*integratedAudio);
% Analyze the bandwidth
% Use FFT to visualize the frequency spectrum
nfft = 2^nextpow2(length(fmSignal));
f = desiredFs/2*linspace(0, 1, nfft/2+1);
Y = fft(fmSignal, nfft)/length(fmSignal);
fmSpectrum = 2*abs(Y(1:nfft/2+1));
% Plot the spectrum
figure;
plot(f, 20*log10(fmSpectrum));
title('Frequency Spectrum of FM Signal');
xlabel('Frequency (Hz)');
ylabel('Magnitude (dB)');
grid on;
xlim([fc-200e3 fc+200e3]);
I hope that the above snippet is clear. For additional information of the functions used, you can refer to the following documentation:
Hope this helps!

Catégories

En savoir plus sur Simulation, Tuning, and Visualization dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by