Closed gotrune closed 11 months ago
I'm pretty sure you can't change the sample rate on the fly on the ADAU1701, it's compiled into the DSP firmware. However, you could have two different firmware that you can switch between. I've never tried it, but it may work with the library out of the box.
The sample rate passed though the constructor is only used when calculating certain filter values, and does not set or change the DSP sample rate at all.
You would need two separate SigmaDSP parameter files, for instance, SigmaDSP_parameters.h
and SigmaDSP_parameters2.h
. You can modify SigmaDSP_paramters2.h of so that you can call loadProgram2(dsp)
or loadProgram2(dsp2)
. Just make sure to rename all arrays in the file.
Ohhh ok i don't think about it. Thanks for the quick answer , i'll test that and i tell you ;)
Hello, Test that and work really fine, thanks a lot. Just have to deal with a define at the begining of the paramaters.h and just remove it in the second program `
`
You said: "The sample rate passed though the constructor is only used when calculating certain filter values, and does not set or change the DSP sample rate at all" Yes i see that, my 200hz filter is now about 183hz... The declaration of multiple constructor make my program more complicated..
My question is: is any easy way to change te fs's constructor ?
SigmaDSP dsp(Wire, DSP_I2C_ADDRESS, 48000.00f /*,12*/);
My question is: is any easy way to change te fs's constructor ?
The library isn't really designed to be able to change the sample rate on the fly.
Remove const
from this line. Now you can change the sample rate used for calculation on the fly by writing to dsp.FS
.
Hi, digging arround 96khz, i find something weird in the sigmadsp.cpp at line 1011-1012
addr[0] = 0x00;
addr[1] = 0x3C; // Set the IST bit (initiate safeload transfer bit)
Wich set the core register at 48khz, i made a litle modification like:
addr[0] = readRegister(dspRegister::CoreRegister,1);
addr[1] = readRegister(dspRegister::CoreRegister,2) + 0b00100000; // Set the IST bit (initiate safeload transfer bit)
And then only modify the safeload bit :) Bye
Hello, first of all a huge thanks for these joby ;) Then i have a custom board with an ADAU1701, an esp12f as master, an stm32 as usb audio device and an si5153c as master clock reference. The stm32 can change its own fs clock (in windows) and telling the esp12 the new FS So the question is: how can i change the fs clock of the adau1701 in the code: I've tried something like that:
But it's doesn't work ...