Tone Control

Algorithm development and general DSP issues

Moderator: frank

Post Reply
frotaitalos
Posts: 16
Joined: Wed Feb 07, 2018 9:06 am
Location: Brazil

Tone Control

Post by frotaitalos »

Hi everyone, this is my first post in the forum, I apologize for the lack of knowledge.

I want to create a tone control for various reverb algorithms that I have modified, my idea is to read the signal input, apply the frequency cut and direct the signal to the reverb. I made several attempts based on the FV-1 documentation, but I did not even get close to achieving this, could anyone help me, or could anyone already have this code created I could share here? I appreciate your help. The idea is that when the pot is at 1 the filter will let pass all the frequencies that the instrument generates, and when it is at 0 it will pass frequencies below 600Hz, basically it is a low pass filter with frequency controlled by the pot.

I have searched a lot here in the forum and found some topics regarding my doubt but none of them finalized the tone adjustment code, I am sending below the code that I have so far.
;
equ LPF reg0
equ tone reg1

; pot tone
rdax pot0, 1
sof 0.570642354 , 0.0383933837
wrax tone, 0
;
ldax adcl
rdfx LPF, 1
mulx tone
wrax LPF, 1
wrax dacl, 0

With this code, when the potentiometer is set to zero, the volume goes to zero practically.
Aaron
Posts: 54
Joined: Wed Mar 04, 2015 8:10 pm
Location: Oklahoma

Post by Aaron »

No need to apologize for asking a question!

You should start by reading though the knowledge base, particularly this section on low pass filters. It explains the behavior of the algorithm and provides the formula for the cutoff frequency. You should also take a look at the instructions and syntax for RDFX. You will need to deconstruct RDFX so that you can vary K.
frotaitalos
Posts: 16
Joined: Wed Feb 07, 2018 9:06 am
Location: Brazil

Post by frotaitalos »

Aaron wrote:No need to apologize for asking a question!

You should start by reading though the knowledge base, particularly this section on low pass filters. It explains the behavior of the algorithm and provides the formula for the cutoff frequency. You should also take a look at the instructions and syntax for RDFX. You will need to deconstruct RDFX so that you can vary K.
Thanks for the help, my friend, I am currently working on studying the knowledge base and scribbled new lines of code


equ temp reg0
equ fcon reg1
equ fil 0.1

; pot pot
rdax pot0, 1
sof 1, 0
wrax fcon, 0
;
rdax dacl, 1
wrax temp, -1
rdfx fil, 0.1
wrhx fil, -1
mulx fcon
rdax temp, 1
wrax dacl, 0

But unfortunately I still do not get a signal at the exit
Aaron
Posts: 54
Joined: Wed Mar 04, 2015 8:10 pm
Location: Oklahoma

Post by Aaron »

This implementation is a shelving filter. You may want to take a look at the input of the filter to make sure you are reading the proper register.
frotaitalos
Posts: 16
Joined: Wed Feb 07, 2018 9:06 am
Location: Brazil

Post by frotaitalos »

Aaron wrote:This implementation is a shelving filter. You may want to take a look at the input of the filter to make sure you are reading the proper register.
I really can not identify the problem, my knowledge with the language of FV-1 is low, my experience is only with C / C +
Aaron
Posts: 54
Joined: Wed Mar 04, 2015 8:10 pm
Location: Oklahoma

Post by Aaron »

The combination of RDFX and WRAX creates a simple lpf. In order to modulate the cutoff frequency we need to deconstruct RDFX. Looking at the block diagram of RDFX:

Image

and assuming the input of the filter is in ACC, we see that RDFX perfoms

ACC - Register * K + register

If we start to reconstruct this without using RDFX it would look like

RDAX input,1
RDAX filter,-1
mulx K
RDAX filter

The only thing left to do is update the filter register.
frotaitalos
Posts: 16
Joined: Wed Feb 07, 2018 9:06 am
Location: Brazil

Post by frotaitalos »

Aaron wrote:The combination of RDFX and WRAX creates a simple lpf. In order to modulate the cutoff frequency we need to deconstruct RDFX. Looking at the block diagram of RDFX:

Image

and assuming the input of the filter is in ACC, we see that RDFX perfoms

ACC - Register * K + register

If we start to reconstruct this without using RDFX it would look like

RDAX input,1
RDAX filter,-1
mulx K
RDAX filter

The only thing left to do is update the filter register.
Dude I got a lot of doubts now :lol:

1st: Should I read the adcl signal and record in input?
2º: Should I register "filter" in some reg?
3rd: To get the output signal I should insert "WRAX dacl, 0" below "RDAX filter, 0?
Aaron
Posts: 54
Joined: Wed Mar 04, 2015 8:10 pm
Location: Oklahoma

Post by Aaron »

Input, Filter, and K were all just used for the sake of example. "Input" should be whatever register you are using for the input to the filter, "Filter" is whatever you want to call your lpf, and "K" is whatever you want to call the cutoff frequency coefficient.

In order to finish the low pass filter you will need to update the "filter" register by writing the output of our additions and multiply to it (WRAX filter).
frotaitalos
Posts: 16
Joined: Wed Feb 07, 2018 9:06 am
Location: Brazil

Post by frotaitalos »

Aaron wrote:Input, Filter, and K were all just used for the sake of example. "Input" should be whatever register you are using for the input to the filter, "Filter" is whatever you want to call your lpf, and "K" is whatever you want to call the cutoff frequency coefficient.

In order to finish the low pass filter you will need to update the "filter" register by writing the output of our additions and multiply to it (WRAX filter).
I have tried this, but I have no signal at the output, can you help me to identify the error?

equ input reg0
equ filter 0.8
equ k reg2

; input filter
rdax adcl, 0.5
rdax adcr, 0.5
wrax input, 0

;pot control
rdax pot1, 1
sof 1, 0
wrax k, 0
;

rdax input, 1
rdax filter, -1
mulx k
rdax filter, 1
wrax filter, 0
wrax dacl, 1
wrax adcl, 0
frank
Posts: 1241
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

You define "filter" as 0.8 but then do "RDAX filter" and RDAX expects a register not a decimal value as the first parameter.
Frank Thomson
Experimental Noize
frotaitalos
Posts: 16
Joined: Wed Feb 07, 2018 9:06 am
Location: Brazil

Post by frotaitalos »

frank wrote:You define "filter" as 0.8 but then do "RDAX filter" and RDAX expects a register not a decimal value as the first parameter.

Hi Frank, I have modified what you said and now I have a high pass filter controlled by the potentiometer, but I want a low pass filter. I changed the "rdfx" and "wrlx" commands to "rdax" and wrax "but I do not get a low-pass filter, it works almost like a volume.

The code below is what works as a high-pass filter



equ input reg0
equ filter reg1
equ k reg2
equ temp reg3



;pot control
rdax pot1, 1
sof 0.9, 0
wrax k, 0
;

; input filter
rdax adcl, 1
rdax adcr, 1
wrax input, 0
;
rdax input, 1
wrax temp, -1
rdfx filter, 0.4
wrlx filter, -1
mulx k
rdax temp,1
wrax dacl, 1
frotaitalos
Posts: 16
Joined: Wed Feb 07, 2018 9:06 am
Location: Brazil

Post by frotaitalos »

frotaitalos wrote:
frank wrote:You define "filter" as 0.8 but then do "RDAX filter" and RDAX expects a register not a decimal value as the first parameter.

Hi Frank, I have modified what you said and now I have a high pass filter controlled by the potentiometer, but I want a low pass filter. I changed the "rdfx" and "wrlx" commands to "rdax" and wrax "but I do not get a low-pass filter, it works almost like a volume.

The code below is what works as a high-pass filter



equ input reg0
equ filter reg1
equ k reg2
equ temp reg3



;pot control
rdax pot1, 1
sof 0.9, 0
wrax k, 0
;

; input filter
rdax adcl, 1
rdax adcr, 1
wrax input, 0
;
rdax input, 1
wrax temp, -1
rdfx filter, 0.4
wrlx filter, -1
mulx k
rdax temp,1
wrax dacl, 1
Now I was able to create the low-pass filter controlled by the pot, I just had to change "wrlx" to "wrhx" and the filter worked perfectly. Thanks for everyone's help.
frotaitalos
Posts: 16
Joined: Wed Feb 07, 2018 9:06 am
Location: Brazil

Post by frotaitalos »

frotaitalos wrote:
frotaitalos wrote:
frank wrote:You define "filter" as 0.8 but then do "RDAX filter" and RDAX expects a register not a decimal value as the first parameter.

Hi Frank, I have modified what you said and now I have a high pass filter controlled by the potentiometer, but I want a low pass filter. I changed the "rdfx" and "wrlx" commands to "rdax" and wrax "but I do not get a low-pass filter, it works almost like a volume.

The code below is what works as a high-pass filter



equ input reg0
equ filter reg1
equ k reg2
equ temp reg3



;pot control
rdax pot1, 1
sof 0.9, 0
wrax k, 0
;

; input filter
rdax adcl, 1
rdax adcr, 1
wrax input, 0
;
rdax input, 1
wrax temp, -1
rdfx filter, 0.4
wrlx filter, -1
mulx k
rdax temp,1
wrax dacl, 1
Now I was able to create the low-pass filter controlled by the pot, I just had to change "wrlx" to "wrhx" and the filter worked perfectly. Thanks for everyone's help.
Hi Guys, I now have my lowpass filter working but it generates a noise when I raise the -3db bridge of the filter, I am sending the code below and I hope someone helps me to eliminate that noise.

rdax input, 1
wrax temp, -1
rdfx filter, 0.1
wrhx filter, -1
mulx krf
rdax temp,1
wrax mono, 0

This above is the code I am using, I made another code where I insert another fixed low pass filter to try to eliminate the noise but I did not succeed.
rdax input, 1
wrax temp, -1
rdfx filter, 0.1
wrhx filter, -1
mulx krf
rdax temp,1
rdax reg11,1
rdfx reg11,0.4935583443
wrax reg11,0.0000000000
wrax mono, 0
Post Reply