DSP Headache

Tag: Code

ArduinoDSP Project

As it turns out I’m not an experienced mathematician, and even if I was; creating sound effects from a stream wasn’t even half the fun I expected it to be.

I managed to complete wiring my sound circuit to the arduino, containing an LM386 amp IC which was alot of fun and only took me 4 days to realize I had accidentally connected the sound-in ground wire to 5V…

But once that was fixed I finally had the software scenario I’ve dreamed of for years since I first attempted to create an digital guitar-effect processor for the NintendoDS.

Finally I had a working Loopback and a signal to process in real-time…

#my dream scenario
loop
  sample = readInput()
  // Do effects stuff here
  sample = sample * 1.5 // Simple right?
  writeOutput(sample)

That’s when I begun trying to figure out how to create an EQ ( Equalizer tool which turns out not to be the same as Equalizing a signal, DSP is an ocean vast and deep).

So at first I naively thought "Well that’ simple right, all I have to do is to create a nice curve which tells me the multiplier of any given frequency.

What I did not grasp at that time was that the sample I’ve read from the stream in the pseudo code above is NOT in the Frequency domain but in the Time domain.
Time/Frequency differences
And for some weird reason that led me on a wild goose chase and I thought I had to convert my stream using a DFT and tried to figure out a few FFT Implementations .

Well that was a blast, first off, I forgot to mention that my project uses an Arduino UNO and the glorious amount of ram that I have left once simple loopback is running is about 1.7KB not much space for software echo or reverb effects.
And well secondly, what exactly was I going to do with that FFT method if I ever got it working?? Sure, I’d have a cool frequency analysis I could draw up in Processing if I’d want to but uh.. That doesn’t even come close to an EQ..

So my current lead is that the phenomena I’m interested in is called “real-time waveform modeling” not signal analysis.
By the time I reached that conclusion my brain felt like it was made of lead, and I had to lie down for whole night closing my eyes and feeling stupid. (Happens to the best of us)

Anyways, today I tested the audio quality of my setup by connecting my guitar and a small pair of PC speakers (instead of my previous development setup: phone playing mp3’s for input and a piezobuzzer for output.)

Replaying music using the phone as input gave me loud and clear sound, no complaints really. But using the guitar I was suddenly presented with lots of static and noise in addition to the barely audible tones when I strummed the strings..

Using a simple method to amplify the input sample by multiplying it with 9; I could hear the guitar alot better but the levels of static were as expected amplified as well and remained dominant.
My guitar features a double set of humbucker-pickups so they should cancel out most of the ambient noise generated by other electronics.
So at present my best guess is that the noise levels are a result of my ignorance in how Capacitors behave in an AC circuit or signal carrying circuit.

The reason for this theory is that I’ve seen discovered other audio circuit designs that are quite alike in nature to mine but they have a few extra capacitors connected between the main signal wire and ground that are supposed to reduce the amount of noise. So that’s probably what I’m going to research once I complete writing this entry.
And I’ve also encountered a glitch or two in my input/output connections that will need to be fixed.

I’ve another theory I originally wanted to record about how to model frequencies in my current time dimension but this feels enough for now.

The following links are notes to myself incase I close my browser:

http://www.idc.ul.ie/idcwiki/index.php/Equalisation
http://www.musicdsp.org/archive.php?classid=4
http://www.audiocheck.net/engineertraining_bands_difficult.php

wohoo! Found what I was looking for:
http://en.wikipedia.org/wiki/Capacitive_coupling
http://en.wikipedia.org/wiki/High-pass_filter
http://en.wikipedia.org/wiki/Low-pass_filter
http://www.kpsec.freeuk.com/capacit.htm

Comment
E72f7ac314b475ff719771214dd589bd?size=48&d=mm Istenes
Cool! I need to visit so you can show off ;)