Sending specific time values from matlab to arduino

You can post your problem related to MATLAB Projects here. We will try our best to help you out.
Post Reply
Posts: 12
Joined: Sat Feb 18, 2017 5:57 am

Sending specific time values from matlab to arduino

Post by Armistead » Mon Mar 06, 2017 12:16 pm

I am reading a audio signal from a file in matlab. I used a stft on it, squared the magnitudes and summed all of them togther. Bascially, I have one power value per frequency spectrum. And I am plottign all of these values. So, what i have now, is that I have the power spectrum from my signal.

Now I was trying to find the x-y coordinates from the peaks in my plot. So that I know at which time, which power value is there. And then I was also trying to find the time distance between those peaks. How much time is gone, until the next peaks come

There is another problem: I have very high power values. The range differs from 50000 to 120000. So what I did, is converting all of those values to percent. Btw, what i am doing here is, using the formel from the linear interpolation. So I have a range from 0 to 100 percent now. I wrote program, which is sending signals from matlab to arduino uno, which controls a vibration motor.

But how can I say him, when and how strong my motor should vibrate and how long he should wait until the next peaks comes ?? Where do I have to define that and why? I have very low experience with arduino, so I had some help.


The converted power values to percent, are saying how strong it should vibrate and at which time.

100 --> strong vibration 10 --> weak vibration

I thought about using PWM for Arduino, since it is converting signals to percent. But I want to send my percent values to arduino.

Post Reply