how to shift frequency?

조회 수: 5 (최근 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 CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by