ΣSigmaStudio Ask AI Русский Log in

Detect sample rate and flag/switch output

SigmaDSP & SigmaStudio owc Feb 28, 2025 00:00 4 replies Original on forum ↗
Subscribe
owc Question
Feb 28, 2025 00:00

We're using a ADAU1701/1401 for a certain project and we would like to automatically flag/switch something else based on the sample rate that's being used in the DSP.

Would there be an easy way to detect the sample rate, and switch one of the GPIO high/low depending on the specific sample rate?

The DSP is being used in self boot mode, so no external ucontroller is being used.

Audio Signal Processors

hardware

SigmaDSP Audio Processors

adau1701

DaveThib Reply
Feb 28, 2025 00:00

Hello owc,

This processor is so simple and not too many fancy features that this would be super difficult. The sample rate is all controlled externally. All the timing the DSP can measure is relative to the sample rate so that will not work. If you have no controller then you have almost no control of the sample rate once the program is compiled and based on the clocks you are sending to the part. If you were to switch over to the ADAU1452 family of parts then you have a lot more you can do. There are sample rate converters so you can monitor the ASRC ratio registers. This sigma300 processor is also able to read and write to its own registers but the 1701/1401 cannot. The 1701/1401 was an awesome part and such an advance in DSPs but it was designed over 20 years ago!

So you want to change something based on the sample rate the DSP is running at. Well, with this processor you determine that is the design phase not at runtime unless you send it clocks at a different rate. I am not thinking of any creative way to do this... The DSP itself will have no ability to know what rate it is running at unless you have some other reference externally.

Dave T

owc Reply
Feb 28, 2025 00:00

Hey Dave,

Thank you so much for getting back so quickly!

I am familiar with the ADAU1452, but unfortunately it's not suitable for this project (size, and costs).

Also aware that the ADAU1401/1701 is pretty "simple" although still (very) capable enough for all audio related things.

But I thought, maybe there is something "clever" that could work that I am unaware off :)

I just came up with a very creative an bare-bones idea of sending the sample rate coming out of the DSP through a (schmitt-triggered) inverter and trough a passive RC filter, followed by a DC blocking capacitor and a little diode bridge.
A 2nd order filter would probably be better, but don't want to add more components, since board space is lacking (a lot!) (could try LC filter)

With a bit of luck this will just be enough to send a low-level or high-level signal to either another inverter or or sample-hold detector with a OR-gate.
With 3V3 logic the high-level is around 2V, so that gives quite some range between the two signals.

.

(schematic drawn with both channels just to be able to compare results, obviously it's just one channel)

The question is if this is good enough for the following stage, which needs either a high or low level to switch between 48kHz or 96kHz for the I²S input

8407.simple_freq_detector.png
8407.simple_freq_detector.png
DaveThib Reply
Feb 28, 2025 00:00

Hello owc,

I am with you that this 1701/1401 is such a great part and still a great solution for many audio applications! This is still one of my favorites! So I fully understand your reasons for using this DSP.

Let's continue this creative discussion! Yes, you could either take a GPIO pin and put in a counter to make the pin go high and low every other sample period. Then filter this out, put in a buffer and send it to one of the AUX ADC inputs. You should be able to measure the difference between significant sample rates. 44.1kHz verses 48kHz might be a little close but certainly 96k verses 48k should be easy to measure. This is something to prototype on the bench and see what you get. You actually would not have to use a GPIO if you have the serial port LRCLK output available. You could buffer that and rectify it.

Now, the only thing I am not clear on is what you will be changing? Any filters in your schematic will be calculated for a certain sample rate. I suppose you can switch between different filters is what you want to do? Then things like compressor time constants could be changed? With no controller it is a little tough but possible. Let's keep talking...

Can you do something else for me? Can you send me a PM and also request friendship so I can respond? I have more proprietary questions to ask.

Dave T

owc Reply
Feb 28, 2025 00:00

Hey Dave,

Request sent ;)