[SHARING] Filter coeficents online calculator with sample code for C++, C#, MicroPython and Arduino Sketch
Hi guys, im sharing an online filter calculator, that can generate sample/example codes for C++, C#, MicroPython and Arduino Sketch, also you can check your own code calculations results
This calculator can generate code examples, easy for use with microcontroller.
folow this Link: Online Calculator
The generated code examples can be used for free, either for personal or commercial use, they do not require a license, nor are they copyrighted!
Edit Notes
Added copyright exemption.
[edited by: Rocha at 6:08 PM (GMT -4) on 16 May 2022]
filter design
filter parameter
software
filters
filter implementation
filter coefficient
Show More
Hello Rocha,
Thanks for the link to this resource.
Dave T
Hello, I still have many questions. For example, I used to use 1452 spi to control. If the first write register address is 0, then it is write. If it is 1, then it is read.
void SIGMA_WRITE_REGISTER_BLOCK(byte devAddress, int address, int length, byte pData[]) {
#if USE_SPI // Start of function for SPI write
// Assert SPI slave select line
digitalWrite(DSP_SS_PIN, LOW); // Assert SPI slave select line (active low)
SPI.beginTransaction(settingsA); // Initialize SPI
SPI.transfer(0x0); // SPI read address + read/!write bit 0 or 1 read or write
SPI.transfer(address >> 8); // High byte of address
SPI.transfer(address & 0xff); // Low byte of address
for (int i = 0; i < length; i++) { // For each data byte in the packet...
SPI.transfer(pData[i]); // Write the data byte to the DSP
}
SPI.endTransaction(); // Release the SPI bus
digitalWrite(DSP_SS_PIN, HIGH); // Pull up the slave select line
// End of function for SPI write
#else // Start of function for I2C write
Now I use i2c to control 1701. I don't know the read/write address. The method is different from that of SPI。
Also, I need to calculate the C language code of the filter. Some parameters of the code downloaded from the online calculation are undefined, and I don't know how to define values. I want to get the code for calculating the filter. There is no such code in the routine you provided for download.
res = coeficents( family, FILTER_2ND_BYPASS, fs, 100, 1.41, 1, 1 );
writeToDspSafeload( address, (unsigned char*)&res, sizeof(res) );
Amp and res are not defined, so I don't know how to define them.
for (int i = 0; i < sizeof(coeficents_t); i++) {
if ( i > 0 && (i+1) % 4 == 0 ) {
Serial.printf("%02X\r\n", (unsigned int)((uint8_t*)&coeficents)[i]);
} else {
Serial.printf("%02X ", (unsigned int)((uint8_t*)&coeficents)[i]);
}
}
Lt is also undefined
Also, how does Crossover Filter calculate? Filter TYpe: How is Linkwitz Filey 24 or Butterworth24 or Bessel 18 calculated?
Just what i was looking for, together with Bob's spreadsheets i was able to create my code for the esp32, however there seems to be a bug in the peaking filter calculations, changing it to the formulas in the spreadsheet worked
Please log in to reply.
