how to shift frequency?
13 views (last 30 days)
Show older comments
How to shift frequency from 40khz to 10khz using simulink?
0 Comments
Answers (1)
Hari
on 24 Feb 2025
Hi,
I understand that you want to shift a signal’s frequency from 40 kHz to 10 kHz using Simulink.
I assume you have a signal source in Simulink generating a 40 kHz signal, and you want to down-convert this frequency to 10 kHz.
In order to shift the frequency from 40 kHz to 10 kHz in Simulink, you can follow the below steps:
Create a Simulink Model:
Open a new Simulink model and add a “Sine Wave” block to generate a 40 kHz signal.
open_system('new_model'); % Open a new Simulink model
Generate the 40 kHz Signal:
Set the “Sine Wave” block parameters to generate a 40 kHz signal.
set_param('new_model/Sine Wave', 'Frequency', '40000', 'SampleTime', '1e-6');
Use a Mixer for Frequency Shifting:
Add a “Product” block to mix the 40 kHz signal with a 30 kHz local oscillator signal, effectively shifting the frequency to 10 kHz.
add_block('simulink/Math Operations/Product', 'new_model/Mixer');
% Create a 30 kHz local oscillator
add_block('simulink/Sources/Sine Wave', 'new_model/LocalOscillator');
set_param('new_model/LocalOscillator', 'Frequency', '30000', 'SampleTime', '1e-6');
Connect the Blocks:
Connect the 40 kHz signal and the local oscillator to the “Product” block.
add_line('new_model', 'Sine Wave/1', 'Mixer/1');
add_line('new_model', 'LocalOscillator/1', 'Mixer/2');
Output the Result:
Add a “To Workspace” block to save the output signal and visualize it.
add_block('simulink/Sinks/To Workspace', 'new_model/Output');
set_param('new_model/Output', 'VariableName', 'shiftedSignal');
add_line('new_model', 'Mixer/1', 'Output/1');
Refer to the documentation of “Product” block to know more about its usage:
Hope this helps!
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!