ΣSigmaStudio Ask AI Русский Log in

How to get the index of a signal

SigmaDSP & SigmaStudio brodytyler Sep 27, 2022 00:00 8 replies Original on forum ↗
Subscribe
brodytyler Question
Sep 27, 2022 00:00

I need to take one from multiple signals, say max peak signal, I can use the following method, but I need more channel processing, how can I do it concisely, thanks

微信截图_20220927093911.png
微信截图_20220927093911.png
Harishgowtham Reply
Sep 27, 2022 00:00

Hello brodytyler,

If you want to detect the signal which has the highest peak among other signals then please look at the below example, I have used sines waves of different amplitudes (gain level) in this example and I ended up getting the highest peak contain signal. I used periodic signals as an input here to show an easy demonstration.

Regards,

Harish

peak.JPG
peak.JPG
peak1.JPG
peak1.JPG
brodytyler Reply
Sep 28, 2022 00:00

Hi Harish,Thank you for your reply, there are 8 signals in the example you gave, we get the signal with the largest peak through the operation, but what I need is the index of the largest signal, which is used to take the original signal, just like the example I gave

Harishgowtham Reply
Sep 28, 2022 00:00

Hello ,

Thanks for the information.

Please look at the below attached pictures. I have 4 inputs. Among those four inputs the signal which has the highest peak will be chosen as the input of the mux. i.e the index control of the mux will be based on the highest peak contain signal.

Ex. The signal with -1dB gain is the highest peak contain signal among others. So that is 4th input (index 3). The index is shown in the readback cell. Then then index 3 is given to the control pin of the mux. So obviously the mux chooses the highest peak contain signal as its input and give it in the output side.

The same set up for eight inputs.

As you asked , You will get the index of of signal which has the highest peak, you can see the index number in the readback cell. If this is what you asked for then please get the attached project.

index.dspproj

Kindly do reply if you need anything.

Regards,

Harish

index2.JPG
index2.JPG
index0.JPG
index0.JPG
brodytyler Reply
Sep 28, 2022 00:00

Thank you again, I wonder if there is a more concise scheme, if I have 16 sets of inputs, I will draw for a long time

DaveThib Reply
Sep 30, 2022 00:00

Hello brodytyler,

I talked with Harish and we decided that I would provide an easier to expand version of this for you.

I created an hierarchy board that will compare the two signals and output the result. It also switches the audio and provides the highest audio out at the end of the chain.

Here is the start of the chain:

Then the end of the chain:

The meter is showing the resulting highest audio so this you should send out of the DSP. I just realized I forgot to put the output block there.

Then I am showing the resulting index for the highest signal level.

All you have to do to expand is copy and paste and then go into the block and update the DC cell that holds the number for the new signal. Do Not change the 0 and 1 DC cells, those drive the MUX blocks.

Here is what is inside the block.

I have built this project for the ADAU1467 like Harish had been showing, then I created the same project for the ADAU1701. There are slight differences between them due to the differences in the DSP cores.

You can find the two projects below.

Dave T

index-DT-Version.dspproj

index-DT-Version-1701.dspproj

pastedimage1664548247286v3.png
pastedimage1664548247286v3.png
pastedimage1664548282685v4.png
pastedimage1664548282685v4.png
pastedimage1664548200825v2.png
pastedimage1664548200825v2.png
brodytyler Reply
Oct 9, 2022 00:00

Think you Dave, You gave me a good idea to return the result of the last operation. The problem now is the lack of computing power. I need to add about 80 instructions to add a signal, which is too much for my 1701. Thanks again

DaveThib Reply
Oct 10, 2022 00:00

Hello brodytyler,

How are you getting 16 channels into the ADAU1701?

Unless you use an external controller to do all of these comparisons then I think you need to upgrade to a Sigma300/350 core. You simply may be trying to squeeze too much out of the 1701.

Dave T

brodytyler Reply
Oct 11, 2022 00:00

Thinks DaveThib. I will try it on 1452.