Go Down

### Topic: Is arduino suitable for this kind of real-time audio processing? (Read 271 times)previous topic - next topic

#### davidco

##### May 17, 2017, 05:36 amLast Edit: May 17, 2017, 06:27 am by davidco
For example a project that would recognize the certain note in a solo piano piece, and cut it out in real-time (or change it to a different note/frequency)?

#1
No.

#### davidco

#2
##### May 17, 2017, 06:08 pm
Can you help me figure out the math here?
I have found this data:
Master clock frequency is 84 MHz
DAC Clock frequency is 42 MHz
ADC clock maximum speed of 200 kHz

Can you clarify where wouold be a bottleneck if arduino would get analog signal, convert it to 10bit values at 200 kHz, analyze values in the main loop (84 MHz/200 kHz=420 cycles between readouts), and if they do not match the note, just pass the same values to DAC and speakers (or do any other bits manipulation before)

#### el_supremo

#3
##### May 17, 2017, 06:22 pm
It's not a matter of crunching those three numbers. The major issue is buried in this phrase:
Quote
if they do not match the note,
Determining the frequency of a musical note takes a lot more CPU cycles than an Arduino can provide. It requires a very fast processor or, better yet, one with DSP instructions.
This gets even more complicated by the original stated requirement that it then
Quote
cut it [i.e. the note] out in real-time (or change it to a different note/frequency)?
Cutting the note out requires recognizing it in the first place and then subtracting that note from the rest of the audio which is another difficult problem. Changing it to a different note would presumably require pitch shifting which is another cpu-intensive problem.
In summary, my (second) opinion is, absolutely not.

Pete
Don't send me technical questions via Private Message.

#### Grumpy_Mike

#4
##### May 17, 2017, 06:30 pm
The bottleneck is in identifying a piano note. That is almost impossible let alone possible in real time. It is not a matter of looking at the the zero crossings because the harmonic content of a piano note changes continuously through the duration of the note. To stand any chance of just identifying a piano note you need to do a running FFT that overlaps sample buffers, yo do not have enough memory to do that in a Due or Zero nore is the clock rate fast enough.

In short you want to do something that is impossible no matter what memory or processing speed you throw at the problem.

#5
##### May 17, 2017, 06:36 pm
"The bottleneck is in identifying a piano note. "
Especially as a piano note is made by a hammer strike 3 strings, and picking up harmonics from other strings and the case and with sustain from other notes added thru the use of the pedals.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### davidco

#6
##### May 20, 2017, 07:20 pm
Thanks guys. I clearly underestimated the complexity of the problem.

#### ronart

#7
##### May 25, 2017, 02:43 am
There is a software package, MidiGuitar 2, that samples (Analog-to-Digital) an electric guitar playing, and gives the "note values" (frequencies) to VST (Virtual Studio Technology) and similar dll (dynamic link libraries), which then play the notes as a saxophone, organ, cello, whatever. BUT, I have spent many hours with it and found that it kinda works with a super fast computer. The guitar problem is this: when the finger is taken off the string, this counts as a hammer off (a note). I guess it would work with other cleaner inputs like piano or voice. Anyways, it is a way-out-there topic.

#### Grumpy_Mike

#8
##### May 25, 2017, 07:11 am
Quote
I have spent many hours with it and found that it kinda works with a super fast computer.
That is the problem, it "kinda works".

Go Up