Wrap/return to zero index when index count is exceeded
Hello,
How to "wrap" index in "Index Lookup Table"?
I use two buttons - one to increase the index, and the other to decrease. This is how I select the eq curves.
I'd like to limit it to one button, only for increase. For example, I have four indexes in the table (0,1,2,3) and when the number of the selected will be 4, I would like it to change to zero.
In programming language it would probably look like this:
if (selectedIndex == amoutOfIndexes) {
selectedIndex = 0;
}
value = table [selectedIndex]
Second question: is it possible to disable "Dynamic Enhancement" or change the value of "boost" based on a selected index from the table? Or disable other components based on the selected index?
Best regards
Edit Notes
I fixed produtct name. I have 1401
[edited by: bnemo at 10:24 PM (GMT -4) on 13 Jul 2023]
Audio Signal Processors
index
Audio Products
software
index selectable filter
adau1401
4.7
table
SigmaDSP Audio Processors
1401
adau1701
1701
Show More
Hello bnemo,
Here is a quick answer and an easy way to do it. There is a GPIO block that does this already.
Here is a project showing how to do this:
8737.ADAU1701 Index Selectable Filter using Up-Down Counter.zip
Your second question is no, not with this processor. If you have a system controller then I can look a little deeper to see if this is possible but this SigmaDSP core is not able to change any of its own parameters.
Dave T
Hello Dave,
thanks for the quick response.
The project you attached doesn't work for me.
I made a mistake in the topic description, I am using ADAU1401. Can you fix the project if it is possible?
Regarding the second question, I don't use a system controller at this moment.
--EDIT--
I have attached my project where I tried to include your suggestions, but it doesn't work.
I was using GPIO6 and GPIO7 to change the index in the table before including your design.
In ReadBack1 I can see the value change when one of the buttons is clicked.
However, I can't understand how this implementation is supposed to work as expected
DaveThib said:
There is a GPIO block that does this already.
Can you explain me? Which block?
eq.zip
Hello bnemo,
the ADAU1701 and the ADAU1401 are functionally identical and pin compatible. One is automotive rated and the other is not. That is the difference. So no need for you to change the DLL over to the 1401.
The Up/Down block does not work exactly like you wanted. It does not return to zero. When you press Up it goes up one index for each click of the switch. When it gets to the top it does nothing but stay at the highest filter index. Then if you press down button it will go down one index for each click until it reaches the bottom. Then it does nothing if you keep clicking. It logically makes sense and will limit to the number of indexes it is set for. So up will go up to the max and no further. Down will go down to the minimum and no further.
You must use momentary switches. If you use a non-momentary switch then it will act like you are holding the button in which case it will repeat rapidly until it reaches the top or the bottom. If both up and down are "pressed" then it is undefined.
I just opened up your project and it works fine. I had to change the MP pins to GPIO 2 and 3 because that is where the switches are on the MINI eval board. Also, the readback you are using was set to 5.19 and should either be set to 24.0 or switch over to hex. I got the output of the UpDown Table to go from 0 to 9 and back.
I also noticed you have the rotary encoder volume control in your project. Those switches function very differently and you cannot use a rotary encoder for the UpDown Table block. You would have to use the regular Rotary Encoder block.
Send over a schematic of your hardware and how the switches are wired and what type of switches they are?
It can be a screenshot of those sections.
Dave T
Hello Dave,
I use DSP board like this:
And rotary encoder with button:
Waveshare 9533
DaveThib said:
I also noticed you have the rotary encoder volume control in your project. Those switches function very differently and you cannot use a rotary encoder for the UpDown Table block. You would have to use the regular Rotary Encoder block.
I use a rotary encoder to change the volume, based on GPIO Conditioning -> Volume Control -> Rotary -> Rotary volume component. It works fine for me. I use MP10 and MP11 to change the volume. This is based on an-951. Is it something wrong here?
This encoder has a push button. In my previous design, I had this button connected to UpDownLUT table, and I could increase the index in the table and change the EQ curve. MP7 is used for this.
DaveThib said:
Also, the readback you are using was set to 5.19 and should either be set to 24.0 or switch over to hex. I got the output of the UpDown Table to go from 0 to 9 and back.
DaveThib said:
The Up/Down block does not work exactly like you wanted. It does not return to zero. When you press Up it goes up one index for each click of the switch. When it gets to the top it does nothing but stay at the highest filter index. Then if you press down button it will go down one index for each click until it reaches the bottom. Then it does nothing if you keep clicking. It logically makes sense and will limit to the number of indexes it is set for. So up will go up to the max and no further. Down will go down to the minimum and no further.
I fixed the readback and I got the output of the UpDown correctly. The index is increased by clicking the push button. Honestly, I don't understand what your project is doing.
This allows to increment/decrement of the index in the table by buttons and reading the values, but it does not control the EQ curve.
I still can't understand how DC Input Entry works.
I'm guessing it should "send" the signal to control the EQ curve, right? However, I don't understand it. Can you explain this design?
At the beginning of this thread, I asked about returning the index to position 0, when the index is out of the array. Your design doesn't respond to my question, right? Do you have any idea how to achieve it? I would like to limit it to one button only to select the curve.
Hello,
There is a learning curve. Here is where the information is located:
SigmaStudio and SigmaDSP Documentation [Analog Devices Wiki]
You can always click on a block and then press F1 and it will open the help page for that block. It does not always work for all blocks but it can be helpful at times.
A DC cell is simply a place to store a number. That is it. It is a constant that your program can read. Since it can be changed then you can think of it as a variable that can be changed. Depends on how you use it. So in the program that you had, I do not think I put that in there? The DC cell was driving the filter select input pin of the index controlled filter. So the DC cell was selecting which filter is active. If you change it then it changes the filter. It is a way of directly controlling an object for testing purposes. Sometimes DC cell is used as a constant like a number to multiply by.
I changed the Up/Down counter to be a Toggle Counter. These are all in the GPIO Conditioning section of the library.
The value you enter in the box is the number of filters you. In this case I put in the number 10 because there are ten filters setup in the index controlled filter. this will cause the output of the toggle counter to start at zero and count to 9. Then it wraps around like you want.
You must make sure the number is not greater than the actual number of filters. Because this number going into the filter block is used as an offset to different sets of filter coefficients. This input is NOT range checked so if you give it a number greater than the number of filters, it will happily go up past the list of coefficients to a space in memory used by some other object and use those numbers for a filter. This will not end well. The results are unpredictable and usually not good.
Here is the updated program. You will have to change the GPIO port to the port that is the push button on your rotary pot.
eq-2DT Edits.dspproj
Dave T
Hello Dave,
Thanks for the clear, detailed answer.
Toggle Counter is what I was looking for. I need to spend more time studying the toolbox.
I had to resign General (2nd-Order/Index Selectable) because it doesn't work properly with adau1401, I replaced it with IdxSelectable Indp. Multiple Band Filter.
I've also noticed that the Toggle Counter doesn't reset to zero when I used Dynamic Processors->Peak->Stand. res.->Low Range->Attack->Mono->Ext Detect->Peak(Attack Hold Decay) component in the project. Maybe it is a bug?
Now I want to learn how to turn on one of the LEDs depending on the selected index to know which "preset" has been selected. I hope it is possible.
Thank you once again
Please log in to reply.