
Cycle by Cycle Average of switching signal in SIMULINK
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Katherine
am 24 Jan. 2024
Beantwortet: Mathieu NOE
am 26 Jan. 2024
Hi MATLAB Community,
I have been trying to find cycle by cycle average of a switching signal in MATLAB. For example, these three switching signals when passed through a moving average block with average time of 1/switching frequency give their perfect average in other softwares as shown below. I want to do the same thing in SIMULINK.

I deally, I would want the average of yellow switching signal (SCOPE1 in the ATTACHED FILE). The moving average block in SIMULINK does not give the desired results. Thanks

0 Kommentare
Akzeptierte Antwort
Mathieu NOE
am 26 Jan. 2024
hello
I would suggest that any well designed low pass filter after the PWM signal should give you the original waveform
here my little demo attached (i could not really use your file) , generated with (R2020b) Simulink Version 10.2
here you can see the LP filtered PWM signal correctly follows the analog input signal that enters the comparator

before starting the slx file , you need to run this (for configuration) :
Fs = 1e5;
dt = 1/Fs;
sig_freq = 2; % Hz
% PWM low pass filter
fc = 25;
[B,A]=butter(3,2*fc/Fs);
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!