필터 지우기
필터 지우기

Simulink to see Fourier

조회 수: 6 (최근 30일)
Robert Scott
Robert Scott 2024년 4월 20일
편집: Pat Gipper 2024년 4월 22일
I have a very simple task but am not being successful.
I have a PWM generator in simulike runing at a certain frequency and certain duty cycle.
I want to take the fourier analysis of it and plot it in a scope.
What i expect to see is the DC component of the perioid signal... (i think?)
So if i have a period signal PWM signal with a magnitude of say 5 and duty cycle of .5 i expect to see a DC of 2.5 out on my scope.
How can i acomplish this? I have tried a few different blocks in simulink but im not getting what im expecting.
Perhaps my expecatations are wrong.

답변 (1개)

Pat Gipper
Pat Gipper 2024년 4월 22일
I put it in a Matlab Fcn block and it seems to work. See the attached file for details.
  댓글 수: 3
Pat Gipper
Pat Gipper 2024년 4월 22일
편집: Pat Gipper 2024년 4월 22일
The memory block on the bottom, "io" retains a pointer into the top memory block, "buffer", where the latest sample of the input "u" is stored. "buffer" is a circular memory for storing the block of data for calculating the FFT. I tried to store this information within the Matlab function, but it was extremely unhappy with this attempt. I also wanted to make the FFT length a variable, and this was also problematical. I gave up on this for now and am just using a 32 (or was it 64, I forget?) point fixed length FFT.
You can find memory in the discrete selection of Simulink.
Pat Gipper
Pat Gipper 2024년 4월 22일
편집: Pat Gipper 2024년 4월 22일
Were you able to open the attached file "fft_fcn.slx"? It was written using Matlab/Simulink 2024a build.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 General Applications에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by