Trying to make xover

Post Reply
sebxx4
Posts: 26
Joined: Mon Jun 27, 2022 8:08 am

Trying to make xover

Post by sebxx4 »

Hello,
I'm trying to make active xover with FXcore. I found xover project on spinsemi and trying to get only lowpass from it. Overall, I think Linkwitz-Riley filter with 24dB/oct will do the job due to flat sum characteristic.
So, here's the code:

Code: Select all

.rn		lf1a_l		r0
.rn		lf1b_l		r1
.rn		lf2a_l		r2
.rn		lf2b_l		r3
.rn		lf1a_r		r4
.rn		lf1b_r		r5
.rn		lf2a_r		r6
.rn		lf2b_r		r7
.rn		kfl			r8
.rn		input_l		r9
.rn		input_r		r10

; frq control
cpy_cs	kfl, POT0_SMTH

; inputs
cpy_cs	input_l, in0
cpy_cs	input_r, in1

; filters
cpy_cc	acc32, lf1a_l
multrr	acc32, kfl
adds		acc32, lf1b_l
cpy_cc	lf1b_l, acc32
multrr	acc32, kfl
multri	acc32, -1
adds		acc32, input_l
cpy_cc	lf1a_l, acc32

cpy_cc	acc32, lf2a_l
multrr	acc32, kfl
adds		acc32, lf2b_l
cpy_cc	lf2b_l, acc32
multrr	acc32, kfl
multri	acc32, -1
adds		acc32, lf1b_l
cpy_cc	lf2a_l, acc32

cpy_cc	acc32, lf1a_r
multrr	acc32, kfl
adds		acc32, lf1b_r
cpy_cc	lf1b_r, acc32
multrr	acc32, kfl
multri	acc32, -1
adds		acc32, input_r
cpy_cc	lf1a_r, acc32

cpy_cc	acc32, lf2a_r
multrr	acc32, kfl
adds		acc32, lf2b_r
cpy_cc	lf2b_r, acc32
multrr	acc32, kfl
multri	acc32, -1
adds		acc32, lf1b_r
cpy_cc	lf2a_r, acc32

; outputs
cpy_sc	out0, lf2b_l
cpy_sc	out1, lf2b_r
Don't know what's wrong, but there are many distortion when cutoff frequency is low. I deleted Q control, don't need it.
sebxx4
Posts: 26
Joined: Mon Jun 27, 2022 8:08 am

Re: Trying to make xover

Post by sebxx4 »

Frank, could you have a look?
Frank
Posts: 159
Joined: Sun May 03, 2015 2:43 pm

Re: Trying to make xover

Post by Frank »

Try the code on your board, does it work? Not work?
sebxx4
Posts: 26
Joined: Mon Jun 27, 2022 8:08 am

Re: Trying to make xover

Post by sebxx4 »

Yes, I've tried. As I said, it generally works. I mean when turning POT0 from 1 to 0, it cuts off the frequency, but it looks like the gain increases with it. And at low frequencies there is much distortion.
Frank
Posts: 159
Joined: Sun May 03, 2015 2:43 pm

Re: Trying to make xover

Post by Frank »

There are no comments in the code so it would be very time consuming to reverse engineer it and we do not have the time. Do the following:

1. Convert the code from FV-1 to FXCore as is, no changes, keep Q, etc. and get it working as is.
2. Comment every conversion, put the FV-1 code in comments followed by the FXCore code you changed it to.
3. After the code is working and commented then start to make changes but comment every change, if you are removing the high pass section do not delete it just comment it out so we can still see the original code.

I cannot stress this enough, always put in comments. If your code is not at least 50% comments there are not enough comments.

Once you do this if there are still problems we can see how you got the code to where it is and look for a FV-1->FXCore conversion error or an error in changing the functionality by removing the HP or Q sections.
sebxx4
Posts: 26
Joined: Mon Jun 27, 2022 8:08 am

Re: Trying to make xover

Post by sebxx4 »

Well, maybe you're right. Maybe I wanted to port it too fast. I'll try to port it all.
Post Reply