![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1601156/image.png)
Cycle by Cycle Average of switching signal in SIMULINK
6 次查看(过去 30 天)
显示 更早的评论
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1598731/image.png)
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1598736/image.png)
0 个评论
采纳的回答
Mathieu NOE
2024-1-26
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1601156/image.png)
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 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!