audio processing on startKit and audio Slice

All technical discussions and projects around startKIT
stdefeber
Active Member
Posts: 35
Joined: Wed Dec 18, 2013 9:20 pm

audio processing on startKit and audio Slice

Post by stdefeber »

My loudspeaker project is slowly taking shape.
In the meantime I am thinking about filters.

Since the speaker is of an open baffle type my filter street looks like;
1. low pass filter for the woofers
2. shelfing filter, for the woofers, to compensate for accoustic short due to the open baffle construction
3. highpass filter for mid and tweet

All filters will be be IIR.

For this I'd like to use my startKit and Audio Slice.
I'd like to assign :
1. one core for left channel processing
2. one core for right channel processing
3. one core for I2S (both Codecs)
4. once core for I2C to configure the codecs

I am slightly worried it will not fit on the startKit and i have no clue yet on how to service 2 codecs with 1 I2S implementation.

Suggestions are more than welcome !

best regards

Simon


markb
Member++
Posts: 18
Joined: Tue Oct 08, 2013 1:53 pm

Post by markb »

Hi Simon,

If efficiently written, one core should be able to run 24 BiQuads filters (These are a type of IIR filter), on a 48KHz stream.

If the processor clock is running at 100 MHz, then for one 48 KHz audio stream, you have about 2000 cycles to process each sample. This should be more than enough to filter 2 channels.

MAC (Multiply & Accumulate) assembler instructions that can operate in a minimum of 1 cycle.
One iteration of a Bi-Quad requires 6 MAC instructions.
Therefore, a theoretical limit of 2000/6 = 347 BiQuads!
Practically this limit will never be reached due to other limitations in the architecture, e.g. pipe-lining of the data. As mentioned above, other people have managed to run 24 BiQuads simultaneaously.
stdefeber
Active Member
Posts: 35
Joined: Wed Dec 18, 2013 9:20 pm

Post by stdefeber »

Thanks for the quick answer.
This opens up possibilities for digital room correction :)

grtz

Simon
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

how to service 2 codecs with 1 I2S implementation.
Just parallel the bclk, lrclk and mclk together and feed to both codecs.

Reconfigure I2S to support multiple data lines (one data line per stereo pair):

Code: Select all

#define I2S_MASTER_NUM_CHANS_DAC 4
and make sure you define the ports for the extra data line

Code: Select all

PORT_I2S_DAC0, PORT_I2S_DAC1
etc.

Our DJ kit does this - see https://github.com/xcore/sc_i2s/tree/ma ... aster_demo for an example of 2 x CODECs on the same I2S bus

It also uses a "blind" I2C write to configure both at the same time ( ignores ACK, assumes control received OK). Works OK..
bearcat
Respected Member
Posts: 283
Joined: Fri Mar 19, 2010 4:49 am

Post by bearcat »

Highly optimized, I have achieved about 70 32bit biquads at 48K per core with 500Mhz tile. You won't need that many for your speaker including room correction.

If you haven't ran across the free "Room EQ Wizard" software yet, you should. It can perform the filter optimizations and calculate the coeffecients all with one measurement. Very easy. First pass correct the speaker response with 10 filters maybe. Second pass correct low frequency room response with another 5, for 15 total. A string of 15 serial 32 bit bi-quads is pushing it for noise. You will not achive 120 dB noise margin with standard 32bit bi-quads. The filter sequence will really need simulated to prevent intra-filter clipping. You must shift the samples X bits to provide headroom, and then post shift them to prevent clipping. How many bits is the question...

Have Fun!