fft Simulink R2019a,RaspberryPi 3B

1 view (last 30 days)
Serhiy Kulishenko
Serhiy Kulishenko on 10 Jul 2019
Answered: Rajani Mishra on 2 Aug 2019
Dear mathworks-support,
in my project, I´m going to analyze the frequency of ac-voltage-signal using Arduino nano, RaspberryPi3B and Simulink.
Arduino analog pins take up the rectified ac-signal.
Raspberry gets the AC-values and time stamp via I^2C and should analyze the signal without the connection to a notebook.
The result should be a device, that receives a ac-signal, runs FFT-analysis and save the data on RaspberryPi.
I realized this idea with Matlab-script and it works like I want to, but with the connection to my notebook. Arduino sends 16 values, once per second via I2C:
8 timestamps and 8 Voltage-values.
The "for-loop" runs for 20 seconds and put all received values in a 2x160-matrix.
This matrix goes to FFT-algorithm, after that, I plot the result.
The problem arises when I try to use Simulink for the same project.
I´m working with Matlab-function-block, to easier put my finished Matlab-script to the Simulink-model.
Unfortunately, I´m not able to create the same
2x160-Matrix with Values with Simulink, that goes with Raspberry. I tried to save the Values to the block "buffer", but it works only in "Normal"-mode, not in External mode.
How can I realize an FFT-analyze with RasbberryPI, with values which I get over 20 seconds? Which Simulink-blocks can help me to save the received values to 1 matrix?
Thank you for your time!

Answers (1)

Rajani Mishra
Rajani Mishra on 2 Aug 2019
I assume Simulink support package for Raspberry Pi Hardware is installed and External Mode is enabled for the project. To be able to solve your query, share what exactly are the error messages you are encountering and your MATLAB script. Looking at how FFT is used in this example may help you to resolve the issue https://www.mathworks.com/help/supportpkg/raspberrypi/examples/audio-visualizer-using-raspberry-pi-sense-hat.html

Categories

Find more on Raspberry Pi Hardware in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!