DSP for the Raspberry Pi - diyAudio
Go Back   Home > Forums > Source & Line > Digital Line Level

Digital Line Level DACs, Digital Crossovers, Equalizers, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 3rd November 2013, 01:59 PM   #1
usul27 is offline usul27  Switzerland
diyAudio Member
 
usul27's Avatar
 
Join Date: Apr 2005
Location: -
Smile DSP for the Raspberry Pi

After the success with my Raspberry Pi DAC it is time to go to the next level: a DSP that can be programmed directly from the Raspberry Pi.
First prototype is working, however I still have some issues with the analog input.
Click the image to open in full size.

The DSP can be used as a sound card (stereo in/out) for the Raspberry Pi, but also as a standalone DSP. Programming is done directly from the Raspberry Pi. Unfortunately there is no free compiler for this DAC available. Therefore you have to use SigmaStudio. From there, the compiled program will be exported, transfered to the Raspberry and then written to the DSP. This is only needed when using a completely different program. Parameters for the running program can be updated on the fly. E.g. you can change filter frequencies of a crossover from command line.

The whole software is still in a very early stage, but the basic functionality is already working.

The DAC can be powered directly from the Raspberry Pi 5V supply, it consumes only 100mA.
  Reply With Quote
Old 4th November 2013, 09:31 AM   #2
maxw is offline maxw  United Kingdom
diyAudio Member
 
maxw's Avatar
 
Join Date: Jun 2004
Location: London
Wow, looks nice! What ADC/DAC IC have you used? What resolution and sampling rate?
  Reply With Quote
Old 4th November 2013, 09:41 AM   #3
diyAudio Member
 
Join Date: Mar 2002
Location: Glasgow
Cool!
__________________
'Like the thirteenth chime from a crazy clock which not only in itself fails to command belief but also casts a certain doubt upon the accuracy of the previous twelve strokes.'
  Reply With Quote
Old 4th November 2013, 10:17 AM   #4
usul27 is offline usul27  Switzerland
diyAudio Member
 
usul27's Avatar
 
Join Date: Apr 2005
Location: -
This DSP uses the onchip ADCs/DACs of the ADAU1701. These are not the best DACs/ADCs on the market, but they perform reasonable well.
Sampling rate depends on the configuration. The DSP can work up to 192kHz, however in that case, there is less processing possible per sample. Therefore for complpex programs the sample rate might by limited to 48kHz.
  Reply With Quote
Old 4th November 2013, 06:20 PM   #5
usul27 is offline usul27  Switzerland
diyAudio Member
 
usul27's Avatar
 
Join Date: Apr 2005
Location: -
I still had some problems with the analog input which works now (just forget to solder a resistor on the other side). That means I can focus on the software development.
Is anybody interested to join the team? The software will be open source.
  Reply With Quote
Old 11th November 2013, 04:12 PM   #6
usul27 is offline usul27  Switzerland
diyAudio Member
 
usul27's Avatar
 
Join Date: Apr 2005
Location: -
Looks good. Today I could finish the basic filter software.
I filters will can be configured by an XML file. Based on this file, the parameters for the filters will be calculated. Only BiQuads are implemented now, I will more on other filters in a later stage.

Here is an example (not the full file), which creates a Butterworth high- and lowpass:
<biquad name="bq11" input="input1" type="highpass1" frequency="200" q="0.7" />
<biquad name="bq12" input="bq11" type="highpass1" frequency="200" q="0.7" />
<biquad name="bq13" input="bq12" type="lowpass1" frequency="2000" q="0.7" />
<biquad name="bq14" input="bq13" type="lowpass1" frequency="2000" q="0.7" />


Click the image to open in full size.

I will work on the web interface in the next days. The web interface will can run on the Raspberry Pi allow direct filter changes over the web interface.
  Reply With Quote
Old 11th November 2013, 04:16 PM   #7
Bigun is offline Bigun  Canada
diyAudio Member
 
Bigun's Avatar
 
Join Date: Jan 2009
Blog Entries: 2
Looks very interesting - above my head for sure.
__________________
"The test of the machine is the satisfaction it gives you. There isn't any other test. If the machine produces tranquility it's right. If it disturbs you it's wrong until either the machine or your mind is changed." Robert M Pirsig.
  Reply With Quote
Old 11th November 2013, 04:18 PM   #8
usul27 is offline usul27  Switzerland
diyAudio Member
 
usul27's Avatar
 
Join Date: Apr 2005
Location: -
The web interface will be easy to use :-)
  Reply With Quote
Old 11th November 2013, 05:09 PM   #9
chaparK is offline chaparK  Luxembourg
diyAudio Member
 
Join Date: Apr 2010
Location: Luxembourg
Congratulations for your hard work! Your project looks very promising.

A quick note, although I'm not sure I understand the example below.

Quote:
Originally Posted by usul27 View Post
Here is an example (not the full file), which creates a Butterworth high- and lowpass:
<biquad name="bq11" input="input1" type="highpass1" frequency="200" q="0.7" />
<biquad name="bq12" input="bq11" type="highpass1" frequency="200" q="0.7" />
<biquad name="bq13" input="bq12" type="lowpass1" frequency="2000" q="0.7" />
<biquad name="bq14" input="bq13" type="lowpass1" frequency="2000" q="0.7" />
If you cascade 2 butterworth second-order sections, then you get a 4th order Linkwitz-Riley with cut-off point at -6 dB (as opposed to a 4th order butterworth with cut-off at -3 dB).

The difference between these filters is illustrated below, with same cut-off frequencies as yours (200 Hz and 2000 Hz). Butterworth is orange, LR is blue.

usul1.png

For some reason, your frequency response plot doesn't look like any of the 4th order Butterworth or LR, which is what you would normally achieve with 2 cascaded 2nd order sections.

Quote:
Click the image to open in full size.
Below is the illustration of a Butterworth and a LR 2nd order (same cut-off frequencies). Your plot looks very much like the orange curve (which is again LR but 2nd order i.e. 12 dB/oct).

usul2.png

Normally you would need only one pair of biquads to implement these filters (one biquad for the low-pass and one biquad for the high-pass). But your example shows 4 biquads.

I can see 2 explanations:
- Your plot is not related to the XML example
- Or your biquads implement only 1st order sections, which is a waste of resources.

Wish you the best with your project!

Nick
__________________
Najda DSP
  Reply With Quote
Old 11th November 2013, 05:31 PM   #10
usul27 is offline usul27  Switzerland
diyAudio Member
 
usul27's Avatar
 
Join Date: Apr 2005
Location: -
Hi,

you're right. I mixed up Butterworth und Linkwitz-Riley. The Filter is a 2nd order Linkwitz-Riley, consisting of 2 first-order Butterworth filters (that's why it is named "lowpass1").
And you're also right, that a biquad filter for a first order filter is a waste of ressources. However, at the moment I have more than enough resources available. The SigmaDSP is really nice for this kind of applications, because it handles a BiQuad in 6 clock cycles. A first order filter would save 2 clock cycles. But using BiQuads even for first order filtering (with B2=A2=0) makes the implementation easier at the moment.

Daniel
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
My DAC for the Raspberry Pi usul27 Digital Source 139 27th June 2014 12:15 PM
Cheap USB- soundcard for raspberry pi knorst Digital Source 29 21st August 2013 05:13 AM
Raspberry Pi & accessories Nikitas Swap Meet 5 5th July 2013 11:47 AM
Raspberry Pi -A New DIY'ers Digital Hub? pinkmouse Digital Source 164 11th June 2013 09:21 PM
rdesktop, a killer application for raspberry pi counter culture Everything Else 0 21st November 2012 02:09 AM


New To Site? Need Help?

All times are GMT. The time now is 04:04 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2