Equalizer using Arduino Due

Equalizer using Arduino Due

Postby Vega » Fri Apr 05, 2013 12:42 am

Hello,

I'm looking to create a multiple-band EQ using the codec shield and an arduino due. I will use 16 bit faders as the input for the EQ values, and I'm wondering if anyone knows about the code for making an EQ. I'm an absolute beginner at this, any help will be much appreciated. Thank you :)
Vega
 
Posts: 3
Joined: Thu Apr 04, 2013 12:18 am

Re: Equalizer using Arduino Due

Postby guest » Fri Apr 05, 2013 10:31 am

the due uses a completely different processor than the uno or duemilanove, which is what the codec shield was designed for. as a result, the codec shield will not work with the due at this time.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Equalizer using Arduino Due

Postby Vega » Fri Apr 05, 2013 3:25 pm

okay, so which arduino should i use out of the uno or duemilanove? and then how would i go about writing the code for an eq?
Vega
 
Posts: 3
Joined: Thu Apr 04, 2013 12:18 am

Re: Equalizer using Arduino Due

Postby guest » Fri Apr 05, 2013 10:51 pm

the leaflabs maple would probably be the best thing to use, as the uno or duemilanove can only do about a dozen multiplies per sample at 44ksps. that means only a second order filter per bandpass. i would reccomend an iir filter, as it requires fewer multiplies to accomplish the same task. there are discussions of it here:

http://www.mikroe.com/chapters/view/73/ ... r-filters/

i have only done a few simple filters.

is this something you want to control via usb? are there other inputs you want to take in? if all you need is a 6 band eq, an analog circut will do a better job.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Equalizer using Arduino Due

Postby rup » Tue Apr 09, 2013 6:18 am

Hi !

I am currently trying to upgrade the library of the codec shield to the arduino due. I think it is much convenient to work with the due than with the mapple, but maybe a question of taste...

I worked on an equalizer (based on this : http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt) on the due, and it works with integrated adc/dac, but I needed a better input and output (12bits is not enough), that's why I want to modify the library.

It didn't seemed too difficult, but I am not an pro, and I have a problem with the audio data transfert.

In the library when you send, it is writen :

while(!(SPSR & (1<<SPIF))){ // wait for data transfer to complete}

But in the due, those SPSR and SPIF don't exist the same way... Can anyone help me to find how to replace this ?

It looks like an SPI communication. Maybe we could use only the SPI library, which works with the due ?

Thx, Rup
rup
 
Posts: 8
Joined: Tue Apr 09, 2013 6:03 am

Re: Equalizer using Arduino Due

Postby guest » Tue Apr 09, 2013 11:45 am

hey rup, that is awesome news!

i can help out a bit if you need it. it is probably better to look at the maple code as it is also an arm processor. its basically an spi transfer, but there is some finicky timing that has to go on, so i used low level commands rather than the spi library. there is a set of nops in there to get the timing just right.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Equalizer using Arduino Due

Postby guest » Tue Apr 09, 2013 3:18 pm

ok, the first hurdle is the fact that the pinout is completely different between the due and the uno. i dont know why arduino insists on doing this, but every time they make a new board, they move where the lines are.

neither the i2c or spi lines are on the right pins anymore, so they will have to be rewired to work. also, the potentiometers are tied to 5v, but the due only accepts 3.3v, so the 5v line will have to be cut out and bridged to the 3.3v bus.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Equalizer using Arduino Due

Postby rup » Wed Apr 10, 2013 2:51 am

For the pinout and voltages, I don't care, because obviously the audio codec board can't work as a shield for the due, like you said. The due needs a custom shield.

I just want to be able to use the wm8731, in order to build my own shield for the due. Currently, I have a wm8731, and I work on a breadboard.

I saw these timming problems, but I am interrested if you can explain me in detail what does this part (where the data is sent and received) of uncommon code, wrote in inline assembly.
What it does seems simple, but I don't find how to tranlate them for the due. I checked also the code on the mapple library, and in both libraries, I think the same trick is used : a kind of spi hack, but with strange low level commands.

I can't find the equivalent commands for the due, so if you have any idea....
rup
 
Posts: 8
Joined: Tue Apr 09, 2013 6:03 am

Re: Equalizer using Arduino Due

Postby guest » Wed Apr 10, 2013 6:07 am

in that case you can use the SSC (serial synchronous controller) in the due. it is intended to talk to codecs via I2S, which is the usual codec protocol. i was using SPI because there is no I2S on the uno. that will speed things up immensely, and make DMA possible. i have never used it before, but someone must have written a library for the chip. perhaps check atmels site for the SAM3X8E.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Equalizer using Arduino Due

Postby rup » Thu Apr 11, 2013 5:49 am

Thanks, I found something really interresting, but it is not easy to understand all of what is done here, and how to use it with arduino environment, especialy when you never worked with atmel studio and true atmel arm code.

This is an example code to playback a wav from an sam3x to a wm8731:

http://asf.atmel.com/docs/latest/sam.co ... index.html
rup
 
Posts: 8
Joined: Tue Apr 09, 2013 6:03 am

Next

Return to Audio Codec Shield

Who is online

Users browsing this forum: Bing [Bot] and 2 guests


cron