Author Topic: DSP recommendation needed  (Read 2207 times)

0 Members and 1 Guest are viewing this topic.

Offline technix

  • Super Contributor
  • ***
  • Posts: 2750
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
DSP recommendation needed
« on: October 11, 2017, 07:46:39 pm »
This is about the Bluetooth headphone adapter, which have turned into a Bluetooth/USB/analog line-in codec/headphone amp.

I am submitting to this architecture for the first board revision:

* DSP with codec: ADAU1701.
* Bluetooth/USB Audio module: Qualcomm CSR64215, streams via I2S
* Microphone ADC: CS5343, two channels tied together
* System Microcontroller: STM32L031F6P6 or STM32F303CCT6, depending on DSP code size and the necessity of onboard tone generation.
* Audio operational amplifiers: LME49721
* Headphone power amplifier: LMH6643.

Some audiophoolery may be committed with the amplifiers and (fairly simplistic) analog circuitry, but the real audiophile crafts stands in the digital domain within the DSP. The next revision will replace the ADAU1701 and STM32 with a ADSP-BF532 fully programmable DSP.

— Original Contents —

I was head aching about the volume control and analog loop for the line input to headphone output, but it occurred on me that I might as well move those features into the digital domain with a DSP sitting between the Bluetooth/USB audio module and the I2S codec. At this location I can not only switch but also mix the streams, implement an equalizer and even insert audio effects.

Stream specs:

* Bluetooth/USB audio module: Qualcomm CSRA64215, I2S stream, 16-bit @96kHz
* Audio codec: Cirrus Logic CS4272, I2S stream, 24-bit @96kHz. Output permanently connected to a fixed OPA-BUF headphone AFE. Input permanently connected to line input.
* Microphone input: I have not decided whether I should MUX it onto line input, or give it a separate I2S ADC, or (in case of DSP with good internal ADC like STM32F373) use the built-in ADC for the microphone.

Here is my questions:

* Does STM32F373, STM32F405 or STM32F722 make a good DSP?
* If a dedicated DSP is preferred, is there any low pin count QFP DSP that supports two (or three) I2S streams and offer enough performance?

Edit: wrong part number
« Last Edit: October 13, 2017, 04:00:33 pm by technix »
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 15202
  • Country: nl
    • NCT Developments
Re: DSP recommendation needed
« Reply #1 on: October 11, 2017, 09:03:25 pm »
Any CPU can be used for signal processing tasks. A DSP is usually crippled in some way so it may not be a good choice. Before selecting a microcontroller you should investigate how much processing power you need. First make the algorithm work on a PC, then run in on a development board (with some form of profiling), optimise if possible based on profiling information and as the last step select the final processor.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline diyaudio

  • Frequent Contributor
  • **
  • Posts: 642
  • Country: za
Re: DSP recommendation needed
« Reply #2 on: October 11, 2017, 10:08:26 pm »
Quote
This is about the Bluetooth headphone adapter, which have turned into a Bluetooth/USB/analog line-in codec/headphone amp.

Consider this.

APPLICATIONS
Smartphones/multimedia phones
Digital still cameras/digital video cameras
Portable media players/portable audio players
Phone accessories products

http://www.analog.com/media/en/technical-documentation/data-sheets/ADAU1761.pdf
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 15202
  • Country: nl
    • NCT Developments
Re: DSP recommendation needed
« Reply #3 on: October 11, 2017, 10:34:43 pm »
 :palm: The list with potential applications listed by the manufacturer is better ignored because it is way to generic and thus useless. There are many ways in which a part can be either unsuitable or total overkill.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline TK

  • Frequent Contributor
  • **
  • Posts: 742
  • Country: us
  • I am a Systems Analyst who plays with Electronics
Re: DSP recommendation needed
« Reply #4 on: October 11, 2017, 11:19:25 pm »
Free Audio DSP Library for ST devices: https://dspconcepts.com/st
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 2750
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: DSP recommendation needed
« Reply #5 on: October 12, 2017, 01:32:37 am »
Quote
This is about the Bluetooth headphone adapter, which have turned into a Bluetooth/USB/analog line-in codec/headphone amp.

Consider this.

APPLICATIONS
Smartphones/multimedia phones
Digital still cameras/digital video cameras
Portable media players/portable audio players
Phone accessories products

http://www.analog.com/media/en/technical-documentation/data-sheets/ADAU1761.pdf
You might have skipped my requirements - the DSP runs entirely in the digital domain, with I2S streams being used as signal I/O. ADAU1761 does not even have the correct interface for my purpose, let alone the cost of development tools.
 

Offline Rasz

  • Super Contributor
  • ***
  • Posts: 2110
  • Country: 00
    • My random blog.
Re: DSP recommendation needed
« Reply #6 on: October 12, 2017, 01:44:39 am »
Bluetooth headphone

at the end of the day you will push audio thru shit lossy low bitrate codec, so it doesnt really matter
Who logs in to gdm? Not I, said the duck.
My fireplace is on fire, but in all the wrong places.
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 2750
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: DSP recommendation needed
« Reply #7 on: October 12, 2017, 03:37:35 am »
Bluetooth headphone

at the end of the day you will push audio thru shit lossy low bitrate codec, so it doesnt really matter
I specifically used the CSRA64215 for its AAC support which is definitely not a shit lossy low bitrate codec. Also it is a three-purpose device which can also work with analog line in and USB. I may even move to a better chip that implements even higher audio sample size and rate in the future.
« Last Edit: October 12, 2017, 04:06:33 am by technix »
 

Offline b_force

  • Super Contributor
  • ***
  • Posts: 1151
  • Country: 00
    • One World Concepts
Re: DSP recommendation needed
« Reply #8 on: October 12, 2017, 11:25:26 am »
I would go for DSPs made by analog devices, since their software (Sigmastudio) is really nice to use.

Otherwise TI has a DAC with a DSP in it and excellent specs.
If it's just for volume control; most DACs have digital volume control build in
"If you can't explain it simply (or at all), you don't understand it well enough." A. Einstein

http://www.oneworldconcepts.com/
 

Offline rsjsouza

  • Super Contributor
  • ***
  • Posts: 2582
  • Country: us
    • Vbe - vídeo blog eletrônico
Re: DSP recommendation needed
« Reply #9 on: October 12, 2017, 12:48:52 pm »
In the High performance floating-point DSP realm, you may want to take a look at both the TMS320C6713B (QFP version available) and TMS320C6748 (no QFP, but a more powerful implementation and a cheaper dev kit). The latter has some audio codec libraries available.
Vbe - vídeo blog eletrônico http://videos.vbeletronico.com

Oh, the "whys" of the datasheets... The information is there not to be an axiomatic truth, but instead each speck of data must be slowly inhaled while carefully performing a deep search inside oneself to find the true metaphysical sense...
 

Online blueskull

  • Supporter
  • ****
  • Posts: 10171
  • Country: cn
  • Power Electronics Guy
Re: DSP recommendation needed
« Reply #10 on: October 12, 2017, 01:09:16 pm »
ADAU family also has digital processors. They are never cheap (not any ADI products, if you compare $/mips with STM32 or AllWinner), but they are virtually code-less and all GUI configurable.
The development environment, Sigma Studio, is free of charge, and low cost eval kits are available.

If you prefer to do the hard way and you only need 16 bit audio (or lower performance 32 bit/24 bit audio), consider ADSP-BF592, which is a $3.55 400MHZ (or $1.99 200MHz) chip with small but enough memory for audio and free GCC compiler support (last Blackfin with GCC support).

If you can read Japanese, there is an excellent book for BF592 and audio applications based on GCC, you can buy it here: https://www.amazon.co.jp/dp/4789848116. The book comes with a board featuring BF592 and ADAU1361 codec. The author also has a web shop selling BF70x boards and some accessories, and the author is very friendly.

To move one step higher, BF70x family can perform native 32*32+72 or dual 16*16+40 MACs with up to 1MB of RAM. They require expensive IDE, but you can get free trial, and the license server doesn't check local time, so you can effectively crack the license if you fiddle with your system date during activation. Refer to this post: http://www.openadsp.com/bbs/topic.asp?id=696&boardid=23&tb=1.
SIGSEGV is inevitable if you try to talk more than you know. If I say gibberish, keep in mind that my license plate is SIGSEGV.
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 2750
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: DSP recommendation needed
« Reply #11 on: October 12, 2017, 02:05:52 pm »
I would go for DSPs made by analog devices, since their software (Sigmastudio) is really nice to use.

Otherwise TI has a DAC with a DSP in it and excellent specs.
If it's just for volume control; most DACs have digital volume control build in
The DSP provides at least audio mixing and routing. I do hope I can also add an equalizer in it.
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 2750
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: DSP recommendation needed
« Reply #12 on: October 12, 2017, 05:11:53 pm »
I am revising the design. It seem to me that ADAU1701 can work for me as a DSP/codec combo. Now I need a separate microphone ADC with 1.8V I2S Audio interface and I2C control, and some kind of low power microcontroller to decode Apple earbuds remote protocol and string things together.

The device have three analog interfaces:
* Line-In, buffered stereo analog input to ADAU1701, 3.5-in TRS connector.
* Line-Out, buffered stereo analog output from ADAU1701, 3.5-in TRS connector
* Headphones, power amplified stereo analog output from ADAU1701 + buffered mono analog input to separate ADC + buffered analog input to microcontroller, 3.5-in TRRS connector

The device have effectively three digital interfaces:
* Bidirectional USB Audio and Bluetooth audio (with AAC and apt-X) from Qualcomm CSRA64215 module,
* Optical S/PDIF output
* Optical S/PDIF input
« Last Edit: October 12, 2017, 05:22:29 pm by technix »
 

Offline b_force

  • Super Contributor
  • ***
  • Posts: 1151
  • Country: 00
    • One World Concepts
Re: DSP recommendation needed
« Reply #13 on: October 12, 2017, 09:07:12 pm »
The auda1701 is a nice little working horse.
But I don't know how critical your application is, because the SNR of the adau1701 is not really good and is some applications really noticable.

Do you actually know there are bluetooth receivers with build in volume/dsp control?
I mean, using the adau1701 just for some basic things is a bit of a waste.
"If you can't explain it simply (or at all), you don't understand it well enough." A. Einstein

http://www.oneworldconcepts.com/
 

Offline diyaudio

  • Frequent Contributor
  • **
  • Posts: 642
  • Country: za
Re: DSP recommendation needed
« Reply #14 on: October 12, 2017, 09:41:02 pm »
I am revising the design. It seem to me that ADAU1701 can work for me as a DSP/codec combo. Now I need a separate microphone ADC with 1.8V I2S Audio interface and I2C control, and some kind of low power microcontroller to decode Apple earbuds remote protocol and string things together.

The device have three analog interfaces:
* Line-In, buffered stereo analog input to ADAU1701, 3.5-in TRS connector.
* Line-Out, buffered stereo analog output from ADAU1701, 3.5-in TRS connector
* Headphones, power amplified stereo analog output from ADAU1701 + buffered mono analog input to separate ADC + buffered analog input to microcontroller, 3.5-in TRRS connector

The device have effectively three digital interfaces:
* Bidirectional USB Audio and Bluetooth audio (with AAC and apt-X) from Qualcomm CSRA64215 module,
* Optical S/PDIF output
* Optical S/PDIF input

Now that you have re-considered your design I will jump in again, have you looked at the ADAU1761 instead? based on your requirements using headphones.. look at the other newer sigma processors first (if you havent already). the adau1701  is old and I think its nearing its support life cycle.

one of things I don't like about the SIGMA processors are they planned planned obsolescence parts and requires a master MCU to control the parameter registers which increases cost. Brute force low level DSP
on a signal processor/mcu is still attractive with the downside of more code/work/cost from an implementation point.
« Last Edit: October 12, 2017, 09:46:46 pm by diyaudio »
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 2750
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: DSP recommendation needed
« Reply #15 on: October 13, 2017, 12:21:41 am »
The auda1701 is a nice little working horse.
But I don't know how critical your application is, because the SNR of the adau1701 is not really good and is some applications really noticable.

Do you actually know there are bluetooth receivers with build in volume/dsp control?
I mean, using the adau1701 just for some basic things is a bit of a waste.

CSR64215 actually does have internal DSP, but it is not flexible enough for me, does not have enough input channels, and the line input ADC only runs up to 48kHz. In the current architecture every input and output have its own 16-bit 96kHz channel to and from the DSP.

I am revising the design. It seem to me that ADAU1701 can work for me as a DSP/codec combo. Now I need a separate microphone ADC with 1.8V I2S Audio interface and I2C control, and some kind of low power microcontroller to decode Apple earbuds remote protocol and string things together.

The device have three analog interfaces:
* Line-In, buffered stereo analog input to ADAU1701, 3.5-in TRS connector.
* Line-Out, buffered stereo analog output from ADAU1701, 3.5-in TRS connector
* Headphones, power amplified stereo analog output from ADAU1701 + buffered mono analog input to separate ADC + buffered analog input to microcontroller, 3.5-in TRRS connector

The device have effectively three digital interfaces:
* Bidirectional USB Audio and Bluetooth audio (with AAC and apt-X) from Qualcomm CSRA64215 module,
* Optical S/PDIF output
* Optical S/PDIF input

Now that you have re-considered your design I will jump in again, have you looked at the ADAU1761 instead? based on your requirements using headphones.. look at the other newer sigma processors first (if you havent already). the adau1701  is old and I think its nearing its support life cycle.

one of things I don't like about the SIGMA processors are they planned planned obsolescence parts and requires a master MCU to control the parameter registers which increases cost. Brute force low level DSP
on a signal processor/mcu is still attractive with the downside of more code/work/cost from an implementation point.

The ADAU1761 does not have enough I2S channels, and I am not fond of handling differential I/O pins here. I am okay with SIGMA DSP as for my application I would need an MCU anyway to decode the remote control protocol used by Apple. This really just gives me more control over the system.

For the next revision, I would skip SIGMA DSP entirely and go straight for ADSP-BF592, as well as go back to the Cirrus Logic codec.
 

Offline b_force

  • Super Contributor
  • ***
  • Posts: 1151
  • Country: 00
    • One World Concepts
Re: DSP recommendation needed
« Reply #16 on: October 13, 2017, 01:56:52 am »
The PCM5252 also has a DSP on board.
But it's still not very clear to me what you actually want to do with that DSP?
What kind of effects etc are you thinking of?

I have been in the field of audio for years and I can't image what kind of DSP effects you would like to have for an headphone.
Maybe some stereo widening etc, but it's easier to do that from the source.
I also don't see what's wrong with 48kHz. Key factor for headphones is the SNR, ESPECIALLY if you want to do volume control digitally.
"If you can't explain it simply (or at all), you don't understand it well enough." A. Einstein

http://www.oneworldconcepts.com/
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 2750
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: DSP recommendation needed
« Reply #17 on: October 13, 2017, 03:02:41 am »
The PCM5252 also has a DSP on board.
But it's still not very clear to me what you actually want to do with that DSP?
What kind of effects etc are you thinking of?

I have been in the field of audio for years and I can't image what kind of DSP effects you would like to have for an headphone.
Maybe some stereo widening etc, but it's easier to do that from the source.
I also don't see what's wrong with 48kHz. Key factor for headphones is the SNR, ESPECIALLY if you want to do volume control digitally.
PCM5252 only provides an output, while I need both input and output - in fact I need more inputs than ADAU1701 offers thus even have to add a separate I2S ADC.
The DSP performs all signal routing and an equalizer. I am not a fan of those super expensive "audiophool" analog components (JRC MUSES02 anyone?) and I am well aware the tuning required for those. So using this DSP I can do most of the routing, switching, mixing and equalizing within the digital domain where SNR or THD does not yet apply, and use one fixed, tuned, characterized and digitally compensated AFE.
« Last Edit: October 13, 2017, 03:08:15 am by technix »
 

Offline b_force

  • Super Contributor
  • ***
  • Posts: 1151
  • Country: 00
    • One World Concepts
Re: DSP recommendation needed
« Reply #18 on: October 13, 2017, 03:12:08 am »
But what kind of eq-ing and mixing do you need to do for an headphone?
I get it for a speaker system, but there is not much to EQ for an headphone.
As far as I understand you have an analog in and maybe two digital in channels.
"If you can't explain it simply (or at all), you don't understand it well enough." A. Einstein

http://www.oneworldconcepts.com/
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 15202
  • Country: nl
    • NCT Developments
Re: DSP recommendation needed
« Reply #19 on: October 13, 2017, 03:55:23 am »
When it comes to volume control it is probably better to do this in the analog domain through a PGA in the DAC instead of throwing bits away.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 2750
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: DSP recommendation needed
« Reply #20 on: October 13, 2017, 05:19:39 am »
But what kind of eq-ing and mixing do you need to do for an headphone?
I get it for a speaker system, but there is not much to EQ for an headphone.
As far as I understand you have an analog in and maybe two digital in channels.
The EQ compensates the AFE and headphone frequency response.

Here are the streams to the DSP, all stereo:
* Input: I2S: Bluetooth/USB Downstream
* Input: I2S: Headphones Microphone (separate ADC)
* Input: I2S: Microcontroller (onboard recorder, DDS tones)
* Input: I2S: S/PDIF (maybe)
* Input: Analog: Line In
* Output: I2S: Bluetooth/USB Upstream
* Output: I2S: Microcontroller (onboard recorder)
* Output: I2S: S/PDIF (maybe)
* Output: Analog: Line Out
* Output: Analog: Headphones

When it comes to volume control it is probably better to do this in the analog domain through a PGA in the DAC instead of throwing bits away.
I am throwing a 24-bit DAC at 16-bit sources (limited by Bluetooth module, as the system have to use one shared I2S clock across all sources) so I can afford some bits being thrown away.
« Last Edit: October 13, 2017, 05:21:54 am by technix »
 

Online Buriedcode

  • Frequent Contributor
  • **
  • Posts: 935
  • Country: gb
Re: DSP recommendation needed
« Reply #21 on: October 14, 2017, 08:02:57 am »
I'm sure you are aware the CSR64215 has its own built-in DSP used for more complicated codecs like Apt-X and Apt-X low latency.  This also has advanced EQ and noise cancellation features that can be configured via a CSR app (providing the CSR64215A ROM version you have has it enabled).

It only has SPDIF as an input, and its I2S output has fixed formats - and provides no master clock, just LRCLK, BCLK which means you may have to use a PLL for MCLK.

Even so, the specs seem somewhat overkill.  The ADC/DAC built in to the SOC may have a LOT of common mode noise, but that its why its outputs are differential.  Also, one cannot switch between I2S, and analogue out, or the formats on the fly - it requires different PSkeys and a core reset.  I guess this is why you're adding a DSP to do sample rate conversion?

Also, whilst bluetooth SOC's supports 24-bit audio, its not actually 24-bit.  Even the best available codecs (Apt-X) are lossy work with 16-bit depth. I think Apt-X HD works with 24-bit, but that isn't available to bluetooth devices.

I've spent a good 6-8 months listening to music via Apt-X and Apt-X LL (for tv) and I'm impressed.  It really does sound quite transparent, but you cannot remove things like small jumps in noise when switching tracks (these are actually output via I2S as well) and you cannot fully disable the notification beeps/stock sounds.  So whilst I disagree with the poster that says it 'pushes audio at shitty bit rate', the idea of throwing a DSP and high quality converters at it to 'make it better' is fruitless.

 

Offline b_force

  • Super Contributor
  • ***
  • Posts: 1151
  • Country: 00
    • One World Concepts
Re: DSP recommendation needed
« Reply #22 on: October 14, 2017, 12:05:24 pm »
Shitty bitrates?
We don't live in the 80s anymore.

It's actually true that most devices are not fully 24-bit, but rather '24-bit compatible'.
This can be very easily seen from the SNR and dynamic range (most manufactures copy-paste these values, but they are not the same).
As I said before, it's important to get your noise low enough, but also (again) that depends what type of headphone are being used.
Proper board design is also part of that equation.

Without the full context we can't give a decent answer.

(and I never get very subjective words like 'transparent sound', that's not how you test and describe such audio devices)
"If you can't explain it simply (or at all), you don't understand it well enough." A. Einstein

http://www.oneworldconcepts.com/
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 2750
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: DSP recommendation needed
« Reply #23 on: October 14, 2017, 03:37:28 pm »
I'm sure you are aware the CSR64215 has its own built-in DSP used for more complicated codecs like Apt-X and Apt-X low latency.  This also has advanced EQ and noise cancellation features that can be configured via a CSR app (providing the CSR64215A ROM version you have has it enabled).

It only has SPDIF as an input, and its I2S output has fixed formats - and provides no master clock, just LRCLK, BCLK which means you may have to use a PLL for MCLK.

Even so, the specs seem somewhat overkill.  The ADC/DAC built in to the SOC may have a LOT of common mode noise, but that its why its outputs are differential.  Also, one cannot switch between I2S, and analogue out, or the formats on the fly - it requires different PSkeys and a core reset.  I guess this is why you're adding a DSP to do sample rate conversion?

Also, whilst bluetooth SOC's supports 24-bit audio, its not actually 24-bit.  Even the best available codecs (Apt-X) are lossy work with 16-bit depth. I think Apt-X HD works with 24-bit, but that isn't available to bluetooth devices.

I've spent a good 6-8 months listening to music via Apt-X and Apt-X LL (for tv) and I'm impressed.  It really does sound quite transparent, but you cannot remove things like small jumps in noise when switching tracks (these are actually output via I2S as well) and you cannot fully disable the notification beeps/stock sounds.  So whilst I disagree with the poster that says it 'pushes audio at shitty bit rate', the idea of throwing a DSP and high quality converters at it to 'make it better' is fruitless.
It is exactly because the CSRA64215 cannot have both analog and I2S output working at the same time that I have to introduce the external embedded codec DSP. I use this DSP to perform signal routing, mixing and equalizing in the digital domain, with a set of fixed AFE's.

I am not implementing S/PDIF for now, and even if I want to it is implemented using a separate S/PDIF to I2S codec and hooked to the DSP. The CSRA64215 S/PDIF port will be left unused along with the analog ports.

The I2S is clocked by the DSP so there goes the master clock. Also CSRA64215 supports USB Audio interface which is where the high quality components really comes into play.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf