This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello Duan,
Please refer to this link for matlab code of EQ: https://e2e.ti.com/support/audio/f/6/p/906715/3351799?tisearch=e2e-sitesearch&keymatch=%25252525252520user%2525252525253A320278#3351799.
Further code below is also for your reference. Note that results may not exactly the same with PPC3 due to calculation precision, but it is right.
b0_PPC3 = b0; % data format is 1.31
b1_PPC3 = b1 / 2; % data format is 2.30, hence need divided by 2
b2_PPC3 = b2;
a1_PPC3 = -a1 / 2; % -1 is software cfg
a2_PPC3 = -a2;
Step 1: Get the b0, b1, b2, a0, a1, a2 parameters from the formula in the Audio-EQ-cookbook:https://webaudio.github.io/Audio-EQ-Cookbook/Audio-EQ-Cookbook.txt
Step 2: Normalize the b0, b1, b2, a0, a1, a2 to get the b0_a0, b1_a0, b2_a0, a0_a0, a1_a0, a2_a0, k.
b0_a0=(b0/a0); %1.31 format
b1_a0=(b1/a0)/2; %2.30 format
b2_a0=(b2/a0); %1.31 format
k1=max(abs([b0_a0,b1_a0,b2_a0])); % Divide by the max value to avoid overflow
if k1>0.99999988079071044921875;
k=k1/0.99999988079071044921875;
b0_a0=b0_a0/k;
b1_a0=b1_a0/k;
b2_a0=b2_a0/k;
else
k=1;
end
a0_a0=(a0/a0);
a1_a0=(a1/a0)/2; %2.30 format
a2_a0=(a2/a0); %1.31 format
Step 3: Transfer the b0_a0, b1_a0, b2_a0, a1_a0, a2_a0 to 32bit 2's complement
[B0,B1,B2,A1,A2] = dec2hex(mod(min(round(2^(32-1)*[ b0_a0, b1_a0, b2_a0, a1_a0, a2_a0]),2^(32-1)-1),2^32));
Step 4: Write the [B0,B1,B2,A1,A2] to the right register address, multiply the value ‘k’ back in the step 2 to the volume register or the b0, b1, b2 of 15th BQ.
BR.
Alix Wan.
Hello Alix Wan,
Can you send the PPC3 software's EQ source code ? We will use the MATLAB tooling to modifyt it and combine this parts to our software.
Due to the project is urgent, We need take many time on the EQ parts. If we can got your source code, It will be easy to speed our project.
Many thanks for your support.
Thanks
Best Regards!
Lily
Hello Lily,
Firstly, red curve, overall equalizer is the sum of the 15 EQs. In our PPC3 GUI, we cannot adjust the red directly.
In fact, we adjust the overal equalizer by adjusting 15EQs independently.
Secondly, to adjust the each EQ, you can use equations of Fc, Q and bandwidth based on the type of the EQ.
BR.
Alix Wan.
Hello Alix ,
For the second question:
Now I can enter numbers or moving sliders to adjust the curve of each EQ.
But I also want to drag the curve by the mouse (let the mouse on the curve and drag the curve by the left mouse button, the EQ value will change according to the curve). It has this function on your demo board.
Thanks
Lily
Hi Lily,
It seems to be related to gui development. Per my check and i am sorry as we cannot provide the source code of the software. Thanks!
BR.
Alix Wan.