필터 지우기
필터 지우기

Comment generer une gapped clock avec Simulink

조회 수: 19 (최근 30일)
Andrea Fontana
Andrea Fontana 2024년 7월 19일
답변: Suraj Kumar 2024년 7월 31일 5:34
Une gapped clock est utilisé dans les implementations telecom pour pouvoir demapper une payload avec un bitrate M depuis un signal qui a un bitrate N. Avec M<N.
Pratiquement on utilise un clock lié à la frequence du bitrate N, auquel, de temps au autres on enlève un pulse.
Un exemple dans l'image en pj.
Dans mon cas, il y a un premier skip après 11 cycles et ensuite un skip après 12 cycles. Ensuite la sequence se repète ... 11 cycles - skip - 12 cycles - skip ... etc etc
J'aurais besoin de generer ce type de signal pour ensuite l'étudier en analyse spectrale.
Pourriez-vous me donner des indication de comment generer sous Simulink ?
Merci d'avance

답변 (1개)

Suraj Kumar
Suraj Kumar 2024년 7월 31일 5:34
Hi Andrea,
Based on my understanding, you want to generate signals similar to a gapped clock i.e. to skip the pulse after a few cycles. To generate the required signals, you can follow these steps:
1. Add the following blocks onto the Simulink canvas:
  • Pulse Generator Block: Generates a periodic pulse and acts as an input to MATLAB Function block.
  • MATLAB Function Block: Implements the logic to skip specific cycles.
  • Scope Block: Visualizes the output signal from the MATLAB Function Block.
2. Configure the Pulse Generator Block with the following parameters:
  • Amplitude = 1 , sets the height of the pulse signal
  • Period = 1 , defines the duration of one complete cycle
  • Pulse Width = 50% , sets the duty cycle of the pulse.
3. Implement the following logic in the MATLAB Function Block to skip cycles as required :
function y = skip_cycles(u)
% Persistent variable to keep track of the cycle count
persistent cycle_count;
if isempty(cycle_count)
cycle_count = 0;
end
cycle_count = cycle_count + 1;
if cycle_count > 23
cycle_count = 1;
end
% Skip cycle logic
if cycle_count == 12 || cycle_count == 23
y = 0;
else
y = u;
end
end
4. Run the model and observe the results from the Scope Block.
You can refer the output given below:
For more information on the ‘Pulse Generator’,’ MATLAB Function’ and ‘Scope’ blocks in Simulink, kindly refer to the following documentations:
Hope this helps!

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!