freeDSP / freeDSP-aurora

freeDSP ADAU1452 with 8 analog input, 8 analog outputs, S/P-DIF I/O, ADAT I/O, USB Audio Class2, WiFi, Bluetooth
Creative Commons Attribution Share Alike 4.0 International
176 stars 55 forks source link

DSP memory holds FIR coefficients in reverse order #105

Closed mike811 closed 2 years ago

mike811 commented 2 years ago

Hello,

tests reveal a maximum phase behaviour of current FIR implementation. This seems to be caused by incorrect order of coefficient upload. According to this: https://wiki.analog.com/resources/tools-software/sigmastudio/toolbox/filters/firfilter Coefficents need to be loaded in reverse order.

As a quick workaround coefficients may be swapped prior upload by a script or via command line e.g: tail -r LIN.txt > LIN_rev.txt

dspverden commented 2 years ago

HI,

please can you verify wether the issue is solved in v2.2.2? I have added the coefficient order reversing to the ESP32 firmware.

mike811 commented 2 years ago

Hello,

seems to work correctly in principle with pre 2.2.2 but there is a difference in frequency response: For example with 2.1.4 and manual coef reversal:

Bildschirmfoto 2022-03-15 um 19 02 36

With pre 2.2.2 and without manual coef reversal:

Bildschirmfoto 2022-03-15 um 19 05 02

Did something regarding PEQ change to cause this?

Regards Michael

dspverden commented 2 years ago

Are there PEQs involved in your setting? Or do I see the FIR only there? I did test it with only FIR active and directly from audio interface back into audio interface and saw the expected FIR response.

dspverden commented 2 years ago

P.S. between 100 and 200 Hz I see a phase change, too. Can it be that you have enabled another filter (PEQ or Phase)?

mike811 commented 2 years ago

No Aurora PEQ were involved. All 10 PEQs had Gain 0. Tested with clean 2.2.1 and pre 2.2.2 FW. Only FIR-inside EQs generated via rePhase. Didn't you mention something about extending PEQs to 10 in FIRs plugin?

dspverden commented 2 years ago

Is there a way to show how the FIR should look like? So what did you design and does Aurora reproduce that correctly. Or send me your filter and I can verify here. Regarding PEQs: Yes the GUI was telling 10 PEQs but SigmaStudio has set it to 8 when copying the block from 8channels to 4FIRs.

mike811 commented 2 years ago

Yes, the first picture with 2.1.4 shows my Woofer with linear phase close to zero. This was only tuned by rePhase EQs and should look like that ;-)

dspverden commented 2 years ago

ok, plz can you send me the text file you uploaded to aurora? I want to make sure that this is processed correctly.

mike811 commented 2 years ago

What ever caused this EQ thing, a new REW<->rePhase session shows good results and is fun to work with! Thanks Raphael. Example:

Bildschirmfoto 2022-03-15 um 20 27 04
mike811 commented 2 years ago

You got mail.

dspverden commented 2 years ago

Yes saw it while I was typing here. Can I conclude from your previous post, that this issue is solved now? Will have a look at your file anyway. Just to be sure with some files from outside of my lab. Thanks for helping with debugging it.

mike811 commented 2 years ago

Yes this reversed coef thing is solved for me.

MarsianCRaute commented 2 years ago

Great! Can't wait to use FIR more often now

mike811 commented 2 years ago

Hello, it seems there is still something going on with the FIR or EQ implementation. After power up today I got this response measured:

Bildschirmfoto 2022-03-17 um 16 59 54

Only after reloading the coef file again I got the nice response from two days ago:

Bildschirmfoto 2022-03-17 um 17 09 04

So there seem to be something wrong with saving and reloading.

dspverden commented 2 years ago

I will verify this today evening.

dspverden commented 2 years ago

Hm, I cannot reproduce that here. Could it be that you did not press "Store Preset"? Because in the IR file you have sent me, I see that you equalize the dip at 100. So the first picture looks a bit like no filter present at all. Btw. the file you have sent me does not fully match your result because I cannot see the LP behaviour in your measurement. This is the file you have sent me: test1 And this is what I measure after a reboot: test2

P.S. I measured directly REW->Aurora->REW

mike811 commented 2 years ago

Hi, sorry for the confusion. I can't reproduce it here either. You are probably right. Maybe I simply forgot to klick store preset when playing around last time...