re: the software tool found here: https://learn.adafruit.com/fft-fun-with ... s/software
Spectrogram.py looks like a nice tool and I'd like to use it with hosts other than the Teensy - could someone please give an example of the data sequence to be sent over serial?
It seems to be:
send fft size
send sample rate
send magnitudes
I'd be great to have a working example packet.
Thanks,
Andy
Using other devices with Spectrogram.py
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_mike
- Posts: 67391
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Using other devices with Spectrogram.py
Porting the code to other microcontrollers will be a medium-difficult challenge.
The code relies on the M4 microcontroller's Single-Instruction-Multiple-Data (SIMD) hardware to process the FFTs. That part of the chip does most of the calculations in parallel rather than making the ALU chug through the same operation for a whole list of data points.
The code relies on the M4 microcontroller's Single-Instruction-Multiple-Data (SIMD) hardware to process the FFTs. That part of the chip does most of the calculations in parallel rather than making the ALU chug through the same operation for a whole list of data points.
- planetside
- Posts: 3
- Joined: Mon Oct 15, 2018 2:43 pm
Re: Using other devices with Spectrogram.py
That's ok, I'm not looking at porting the FFT processing part yet - I'd just be really helpful to know the exact series of data that Spectrogram.py is looking to receive over serial so that I can display it.
The communication sequence isn't documented - it's just fft size, sample rate and then the magnitudes? Is that to be sent as one line, multiple lines, separating characters, are the magnitudes floats or ints etc?
The communication sequence isn't documented - it's just fft size, sample rate and then the magnitudes? Is that to be sent as one line, multiple lines, separating characters, are the magnitudes floats or ints etc?
- adafruit_support_mike
- Posts: 67391
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Using other devices with Spectrogram.py
The command set is listed in the COMMAND PARSER FUNCTIONS section at the bottom of the spectrum.ino and toneinput.ino sketches for the microcontroller.
- planetside
- Posts: 3
- Joined: Mon Oct 15, 2018 2:43 pm
Re: Using other devices with Spectrogram.py
Thanks Mike. I wrote a test script for Arduino which sends random data to Spectrogram.py
Code: Select all
// Arduino test script for Tony DiCola's Spectrogram.py
long randNumber;
void setup() {
Serial.begin(38400);
randomSeed(analogRead(0));// use analog value as random seed
}
void loop() {
Serial.println("256"); //send fft size
Serial.println("128"); //send sample rate in hz
while(1){
for (int i=0; i<256; i++) // send magnitudes
{
randNumber = random(829);
Serial.println(randNumber); //send random magnitude
}
delay(500);
}
}
- adafruit_support_mike
- Posts: 67391
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Using other devices with Spectrogram.py
Glad to hear you got it working. Happy hacking!
Please be positive and constructive with your questions and comments.