DSP recommendation needed - Page 1
Forum section: electronics / general

author: technix
author_rank: Super Contributor
timestamp: October 11, 2017, 08:46:39 am
content: 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

author: nctnico
author_rank: Super Contributor
timestamp: October 11, 2017, 10:03:25 am
content: 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.

author: diyaudio
author_rank: Frequent Contributor
timestamp: October 11, 2017, 11:08:26 am
content: QuoteConsider this.APPLICATIONSSmartphones/multimedia phonesDigital still cameras/digital video camerasPortable media players/portable audio playersPhone accessories productshttp://www.analog.com/media/en/technical-documentation/data-sheets/ADAU1761.pdf

author: nctnico
author_rank: Super Contributor
timestamp: October 11, 2017, 11:34:43 am
content: 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.

author: TK
author_rank: Super Contributor
timestamp: October 11, 2017, 12:19:25 pm
content: Free Audio DSP Library for ST devices:https://dspconcepts.com/st

author: technix
author_rank: Super Contributor
timestamp: October 11, 2017, 02:32:37 pm
content: Quote from: diyaudio on October 11, 2017, 11:08:26 amYou 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.

author: Rasz
author_rank: Super Contributor
timestamp: October 11, 2017, 02:44:39 pm
content: Quote from: technix on October 11, 2017, 08:46:39 amat the end of the day you will push audio thru shit lossy low bitrate codec, so it doesnt really matter

author: technix
author_rank: Super Contributor
timestamp: October 11, 2017, 04:37:35 pm
content: Quote from: Rasz on October 11, 2017, 02:44:39 pmI 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.

author: b_force
author_rank: Super Contributor
timestamp: October 12, 2017, 12:25:26 am
content: 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

author: rsjsouza
author_rank: Super Contributor
timestamp: October 12, 2017, 01:48:52 am
content: In the High performance floating-point DSP realm, you may want to take a look at both theTMS320C6713B(QFP version available) andTMS320C6748(no QFP, but a more powerful implementation and a cheaper dev kit). The latter has some audio codec libraries available.

author: technix
author_rank: Super Contributor
timestamp: October 12, 2017, 03:05:52 am
content: Quote from: b_force on October 12, 2017, 12:25:26 amThe DSP provides at least audio mixing and routing. I do hope I can also add an equalizer in it.

author: technix
author_rank: Super Contributor
timestamp: October 12, 2017, 06:11:53 am
content: 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 connectorThe 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

author: b_force
author_rank: Super Contributor
timestamp: October 12, 2017, 10:07:12 am
content: 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.

author: diyaudio
author_rank: Frequent Contributor
timestamp: October 12, 2017, 10:41:02 am
content: Quote from: technix on October 12, 2017, 06:11:53 amNow 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 DSPon a signal processor/mcu is still attractive with the downside of more code/work/cost from an implementation point.

author: technix
author_rank: Super Contributor
timestamp: October 12, 2017, 01:21:41 pm
content: Quote from: b_force on October 12, 2017, 10:07:12 amCSR64215 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.Quote from: diyaudio on October 12, 2017, 10:41:02 amThe 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.

author: b_force
author_rank: Super Contributor
timestamp: October 12, 2017, 02:56:52 pm
content: 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.

author: technix
author_rank: Super Contributor
timestamp: October 12, 2017, 04:02:41 pm
content: Quote from: b_force on October 12, 2017, 02:56:52 pmPCM5252 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.

author: b_force
author_rank: Super Contributor
timestamp: October 12, 2017, 04:12:08 pm
content: 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.

author: nctnico
author_rank: Super Contributor
timestamp: October 12, 2017, 04:55:23 pm
content: 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.

author: technix
author_rank: Super Contributor
timestamp: October 12, 2017, 06:19:39 pm
content: Quote from: b_force on October 12, 2017, 04:12:08 pmThe 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: HeadphonesQuote from: nctnico on October 12, 2017, 04:55:23 pmI 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.

author: Buriedcode
author_rank: Super Contributor
timestamp: October 13, 2017, 09:02:57 pm
content: 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.

author: b_force
author_rank: Super Contributor
timestamp: October 14, 2017, 01:05:24 am
content: 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)

author: technix
author_rank: Super Contributor
timestamp: October 14, 2017, 04:37:28 am
content: Quote from: Buriedcode on October 13, 2017, 09:02:57 pmIt 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.