how to shift frequency?

6 ビュー (過去 30 日間)
RGB LTD
RGB LTD 2014 年 11 月 27 日
回答済み: Hari 2025 年 2 月 24 日
How to shift frequency from 40khz to 10khz using simulink?

回答 (1 件)

Hari
Hari 2025 年 2 月 24 日
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!

カテゴリ

Help Center および File ExchangeSimulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by