**Category:**Software

Hello. I am doing tone control with Sigma studio. The schematic below works for me. It works the way I want. I want to control it with the processor. I don't understand how it generates these 5 datas. Limited data is shared on some sites I've reviewed. I added the sites. Can you share the calculations with me? What can I do? What is the way to generate this data? Is there a document or link with calculations for all toolboxes? It is upsetting to go through a continuous research process for each toolbox. It would make everyone's job easier if you could collect them in a single file.

I've included a work I did below. My calculations do not match the results in the image. I am aware that my calculations are inaccurate. What are the relevant formulas?

Thanks.

Good day.

#include <stdint.h>

#include <math.h>

//using namespace std;

uint32_t SIGMASTUDIOTYPE_FIXPOINT_CONVERT(double value) {

return (uint32_t)(value * (0x01 << 23));

}

int main(){

double PI = 3.14159265;

double dBgain = 0.00;

double frequency = 100.00;

double sampleRate = 48000.00;

double Q = 1.41;

double bandwidth = frequency/Q;

double A = pow(10, dBgain / 40);

double omega = 2 * PI * frequency / sampleRate;

double alpha = sin(omega) / (2 *A * Q);

double gainLinear = pow(10, (dBgain / 20));

double a0 = 1 + alpha/A;

double a1 = 2 * cos(omega);

double a2 = 1 - alpha/A;

double b0 = (1 + alpha * A) * gainLinear;

double b1 = (2 * cos(omega)) * gainLinear;

double b2 = (1 - alpha * A) * gainLinear;

int B0 = SIGMASTUDIOTYPE_FIXPOINT_CONVERT(b0 / a0);

int B1 = SIGMASTUDIOTYPE_FIXPOINT_CONVERT(b1 / a0);

int B2 = SIGMASTUDIOTYPE_FIXPOINT_CONVERT(b2 / a0);

int A1 = SIGMASTUDIOTYPE_FIXPOINT_CONVERT(a1 / a0);

int A2 = SIGMASTUDIOTYPE_FIXPOINT_CONVERT(a2 / a0);

printf(" B0 = %X \n B1 = %X \n B2 = %X \n A1 = %X \n A2 = %X \n", B0, B1, B2, A1, A2);

printf(" B0 = %f \n B1 = %f \n B2 = %f \n A1 = %f \n A2 = %f \n", b0/a0, b1 / a0, b2 / a0, a1 / a0, a2 / a0);

}

Result:

B0 = 800000

B1 = FECB9E

B2 = 7ED134

A1 = FECB9E

A2 = 7ED134

B0 = 1.000000

B1 = 1.990589

B2 = 0.990759

A1 = 1.990589

A2 = 0.990759

Sigma Studio Medium Size EQ calculations

Calculating Filter Coefficients to Store in a Microcontroller