DSP - how, why, tro...
 
Notifications
Clear all

DSP - how, why, troubleshooting, different hardware, etc.

Page 3 / 6

ElliottDesigns
(@elliottdesigns)
Reputable Member Moderator
Joined: 2 years ago
Posts: 254
 

@ajc9988 that's good and all but to program these chips (unless it's a wondom), you need a device called a usbi and these can be very expensive. Otherwise, yes it does look very compelling.

On another note, I just found out that the teensy 4.0 can be safely overclocked to 1Ghz! When using a black pi heatsink though. But this is only 200Mhz off of double the clocks per cycle, nearly doubling the performance of the chip, which is insane! Although we are still limited to 16bit 44.1khz, but to be honest I'm happy with that. 16bit actually goes well beyond what we can hear at reference level, especially when room noise floors are considered. As for the 44.1khz, I have never actually heard a difference between that and even 192khz and that's using my sennheisers and a 32bit DAC with 144db snr.

Elliott Dyson - Mechanical Engineering Student and 3D printing & Design Freelancer


ReplyQuote
ajc9988
(@ajc9988)
Estimable Member Registered
Joined: 9 months ago
Posts: 213
Topic starter  

@elliottdesigns - I thought I used to see those USBi emulator programmers for cheaper. But for that one, now I only see it for $35 or more. So I guess grabbing it bundled isn't as bad as I thought (I used to see those for cheaper I thought). Chalk one up for getting it wrong. LOL.

And you are right to point out that it is practically impossible, from tests from engineers decades ago, to determine above 44.1 or 48kHz. That is why they determined to use those rates as the standards. People can chase the dragon on lower distortion (which some have suggested it isn't distortion that causes a bad listening experience) or lower noise to the point where there are diminishing gains.

The teensy will be able to do the bulk of what anyone would need. Same with a raspberry pi. And the Teensy is already overclocked from the stock speed for a Cortex-M7, meaning at 1GHz, it is going double what was mentioned in the one comparison powerpoint that I had tagged. That would mean dividing the cycles to process in half because you doubled the cycles in a period.


ReplyQuote

ElliottDesigns
(@elliottdesigns)
Reputable Member Moderator
Joined: 2 years ago
Posts: 254
 

@ajc9988 yikes you are lucky. Here is the UK, the cheapest I can find in terms of usbi is £100, with most being closer to 200-300!

Yeah, and if using that code I mentioned a while ago, it means a total close to 40,000 taps 🤣

Elliott Dyson - Mechanical Engineering Student and 3D printing & Design Freelancer


ajc9988 liked
ReplyQuote
ajc9988
(@ajc9988)
Estimable Member Registered
Joined: 9 months ago
Posts: 213
Topic starter  

@elliottdesigns - If searching for the EVAL-ADUSB2EBUZ, here are some listings on Ebay and ali that are cheaper than that:

https://www.ebay.com/itm/283961323840?hash=item421d69f140jNoAAOSwzTpfH8VZ

https://www.ebay.com/itm/154024798406?hash=item23dc97e8c63u4AAOSwaHhfINi0

https://www.aliexpress.com/item/1005001813221271.html?algo_pvid=ec6e3597-93b0-4d5a-a374-1e951cdcb7ee&algo_exp_id=ec6e3597-93b0-4d5a-a374-1e951cdcb7ee-0&pdp_ext_f=%7B%22sku_id%22%3A%2212000017718297731%22%7D

That, of course, is excluding import duties, shipping, and any additional VAT for those who have VATs to worry about.

But, man, that expensive is nuts! At that price, you could buy the ICE1000 JTAG from ADI (analog Devices Inc.). See https://www.digikey.com/en/products/detail/analog-devices-inc./ADZS-ICE-1000/5175780?utm_source=505&utm_medium=supplier&utm_campaign=buynow .

Edit:
And here is the ADI version that they made as an evaluation board:
https://www.digikey.com/en/products/detail/analog-devices-inc./EVAL-ADUSB2EBZ/1944259?utm_source=505&utm_medium=supplier&utm_campaign=buynow


ReplyQuote

ElliottDesigns
(@elliottdesigns)
Reputable Member Moderator
Joined: 2 years ago
Posts: 254
 

@ajc9988 I don't even know what those last two are 😂. But yeah import taxes would be terrible from America but that AliExpress one should be fine. Good to know for any others that want to go that route here in England. I think I'll stick to my teensy stuff though, I find it a lot easier to program than sigmastudio anyways.

Elliott Dyson - Mechanical Engineering Student and 3D printing & Design Freelancer


ajc9988 liked
ReplyQuote
ajc9988
(@ajc9988)
Estimable Member Registered
Joined: 9 months ago
Posts: 213
Topic starter  

@elliottdesigns - The JTAG Emulator is for playing with the evaluation boards being cranked out by ADI. Basically, ADI creates evaluation boards to give people an idea of what can be done with their projects. But, they are complying with the JTAG standard for debugging, so that is its own can of worms (see Louis Rossmann videos for his destruction of JTAGs on Apple boards, lol). The last one in the edit for $100 looks like the wondom programmer, but is from ADI for evaluation purposes. Definitely would pass on that at that price, although the ADI one can connect both i2c and SPI, instead of wondom's only connecting i2c IIRC.

But I am glad that there are options for England.

I am actually better with sigmastudio than traditional programming. I can do alright with programming, but I often forget one word here or a flag there and have to go back and redo it again and again. With sigmastudio, each thing dragged onto the program is a graphical representation of the module or code piece where you just input the information that would have to be manually changed for your scenario in traditional coding anyways. Because of that, it acts as a shorthand, at least for me, in laying out the program. But, different strokes. And I would not be able to use a graphical programming tool like sigmastudio but for the coders that coded each module and block that is graphically represented in the program.

I mean, I can look at code and once in awhile find where I went wrong, but if it comes to a spacing issue, tabs versus spaces, or something like that, not always am I the best to find that. It's like tracking down the error in the Python script that was basic and reformatted text files to then bring into other programs like REW to SigmaStudio. It still took me awhile to track down that error. With linux, I'm learning the syntax along with learning to check on what I need to change. I'm OK with it, just not as fast.

Now, camilledsp seems fairly easy to do a multi-way crossover in the program, which is why I was going to do that with the RPi. Then I found out Wondom makes the JAB5 without being able to output and input at the same time with i2s. So, then comes the question of how to address it.

My first thought is to get a second board that can act as a master and do piecemeal upgrades. My second thought is to just use what I have and design new plate amps at different price points with different features and build a replacement that can slap in sometime in the future. And then I started researching low distortion, low noise amplifier boards and power supplies and rectifier boards and input buffer boards, etc.

But, I do agree, the Teensy and the RPi are great routes. I'd have to learn a bit more linux, but that is me, not them. Turns out I probably properly loaded the driver for the RPi and probably also did the device tree overlay properly. But because of JAB5 not allowing for in and out at the same time over the lanes I was using, I cannot know without buying a proper ADC/DAC HAT for it. After that part of it, the rest should be easy. I basically mirrored the pin assignments of the Hifi berry. I'll repost links to the sources that helped me find out how to connect it and do the overlay as soon as I find which tabs I have it in on my browser (I'm a tab whore, leaving everything open; probably over 1000 tabs open in multiple browser windows).

Edit:

Here was one of the sources (but working on a DAC/ADC for a Jetson Nano or RPi):

image

https://kentaromitsuyasu.medium.com/creating-an-audio-input-output-board-for-raspberry-pi-jetson-nano-pcm5102a-pcm1808-e3e6f3ad0834

 

Detailed writeup of RPI music server with crossover:
https://www.instructables.com/Raspberry-Pi-Music-Server-With-Built-in-Crossover-/

Discussion of some commands to check things regarding i2s

https://forum.digikey.com/t/raspberry-pi-i2s-driver-slave/13320

discussion of Volumio and i2s options, including DACs and a master clock board with an ess sabre 9023 (DIYINHK)

https://volumio.org/raspberry-pi-i2s-dac-sounds-so-good/

Fast install for setting up modules needed and loading the drivers for the hifi-berry (with slight modification, this can be adapted to a number of devices, especially if the same pinout described above is used with pins 12, 35, 38, and 40).
https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp/raspberry-pi-usage

https://bytesnbits.co.uk/raspberry-pi-i2s-sound-output/

GPIO function chart, including showing ALTs for the pins
https://elinux.org/RPi_BCM2835_GPIOs

I know I am missing one other source that discussed the topic, but this is a good start for someone trying to pick up from here.


ReplyQuote

Nixem
(@nixem)
Eminent Member Registered
Joined: 3 months ago
Posts: 23
 

@ajc9988 @elliottdesigns This is a good DSP thread. I'll throw in something ive been looking at.

 

I have been trying to understand SPI/i2c controls for sigmastudio and am having a hard time.

 

I was thinking it would be cool to have an arduino or something simple be able to remotely control digital volume or source selection to the ADI board. Individually the arduino and ADI boards seems to be capable and easy enough for the novice, however, when you try to interface them is where I get lost. 

 

Any idead or reading material to suggest?

 


ReplyQuote
ajc9988
(@ajc9988)
Estimable Member Registered
Joined: 9 months ago
Posts: 213
Topic starter  

@nixem - So, can you tell me which board for Analog Devices Inc. chip is being used? I also forgot to include the link, but you have to do a loop in sigmastudio.

image

If you look at this image, on the board I have, 0 and 1 equate to analog in, 4 and 5 are bluetooth in, with 0 and 4 being left and 1 and 5 being right (or vice versa). Now, 2 and 3 are digital in on Sdata_in_0, IIRC. I will look for the post from the sigmastudios wiki where they lay it out.

In any case, what I was trying to do (before finding out that Sure Electronics/Wondom wired the JAB5 to ONLY allow digital out or digital in over the MISO/MOSI i2s lines, which would connect to the device similarly to the SPI rather than i2c, which is preferred because i2c is the slowest and on this board is reserved for comms with the micro-controller). So, if you were doing an out and inbound digital signal, that is how you do it, with digi0 and digi2 being left and right digital out, respectively.

Now, if designing for a digital input, such as having a ADC on the arduino, then you would instead of looping simply output the digital signal from the arduino to the digital input on the dsp board, which then is input 2 or 3 or both, depending on how you are setting it up, then you design your schematic and exit through the digital out, with dig0 for left and dig2 for the right channel, sending that digital signal straight to the amplifier board you selected.

Does that make more sense? As to showing which pins to connect to wire the boards together, I'd have to see the boards and familiarize myself with their inputs and outputs.


ReplyQuote

Nixem
(@nixem)
Eminent Member Registered
Joined: 3 months ago
Posts: 23
 

@ajc9988  

 

I have an adau1701 which I will be donating to a friend soon and I have an adau1467 on the way. I don't have a microcontroller yet, just started looking into them. Sounds like Arduino, ESP32, or Teensy 4.0 would be good. I heard Arduino is most beginner friendly, but leaning towards Teensy 4.0. I do not have any experience programming microcontrollers. 

Originally I was thinking the microcontroller to control the ADI board, so the microcontroller would tell the ADI board which input to use, it would only be controlling and not providing any audio input itsself. I wasn't sure how this works, and it has been kinda hard figuring it out so far. Basically whatever a button or pot could do, the microcontroller would do. Ex. Volume, input selection, etc. I am hoping to be able to have an IR remote and change inputs or adjust volume.

I stumbled across this: https://ez.analog.com//dsp/sigmadsp/f/discussions/67296/general-purpose-input-parameters-controlled-by-an-external-microcontroller

Is this along the right track, kinda like a virtual GPIO where communication comes from i2c/SPI into ADI board but sees GPIO? Or is there some other way to achieve this?

 

Thanks!


ReplyQuote
Nixem
(@nixem)
Eminent Member Registered
Joined: 3 months ago
Posts: 23
 

@elliottdesigns

Do you have any MATLAB/Simulink experience?


ReplyQuote

ajc9988
(@ajc9988)
Estimable Member Registered
Joined: 9 months ago
Posts: 213
Topic starter  

@nixem -

Well, if written properly, the microcontroller won't switch input, the ADI chip will. There are a couple ways to do this (if you do it wrong, then the audio will not be as loud). The easiest way is an input mixer, like in my examples above. It takes and mixes all signals into the mixer, then outputs the composite. It is like using the logical add function, as adding one signal (1) with another signal (0) still comes out to (1). But, this has a severe flaw: if a signal is coming in from both sources at the same time, you just mixed both sources together, resulting in a mess.

The next way to do it is to create a muxer. With a muxer, you can put in a switch to go between sources. This can be triggered from either a GPIO or an Auxiliary ADC Input, or both.

image

If I did this right (I'd have to double check because I do not currently have a reason to run the XOR logic in my designs), then when input comes from one source or the other, it should logically exclude the other input, meaning you can run it from a physical switch, rotary, etc., or you can run it from the GPIO, which is your stated purpose.

That post seems to be the right track.

Now, where to select the sdata input to be the gpio, I do not know.

image

In this example, SData_0 or SData_1 (I forgot which is assigned to input 2) can be plugged in as one of the two sources for the logic Xor command. The input is the input from the external digital source. That does not mean it has to be i2s. Whether or not hooked up this way works, I do not know. And I currently am not able to test this. I probably could try, but since I've never done it, it could take a couple hours, could take a day or two (accounting for the nuance related to the specific JAB5 board I have).

But, that is to start to get you thinking about the use of muxers and triggers. If you need a DC bias, there are ways to add that as well, but I did not cover that above (I'd have to go back and check sources to make sure it is correct).

Also, the reason for my uncertainties is I threw the ADAU1467 in for this example, but I was not familiar with this specific chip in sigmastudio. As such, I could not find under the hardware tab which sub-tab contained the information needed regarding setting an external source to be a specific GPIO. That doesn't mean it isn't possible, just that I have not found it yet.

Does that help?

Also, if you set a muxer up wrong, it will effect the output volume negatively. So compare with a mixer for sanity check, then look for if your implementation is incorrect.

There are also GPIO conditioning tools to familiarize yourself with.

Sorry if not the perfect answer, but I do hope this helps to move along your implementation.


ReplyQuote
ajc9988
(@ajc9988)
Estimable Member Registered
Joined: 9 months ago
Posts: 213
Topic starter  

@nixem - Unfortunately, I do not have experience with either. I'll have to learn a little matlab at some point, but I've been pushing that off.

edit:

Here is an example of how Wondom did their logical switching for XOR for GPIO input, also using a DC bias, a multiplier, and many mux operations to select whether the signal is for the left or for the right.

image

If you are not used to hierarchy boards being used, here is this:

image

That is the baseline JAB5 program but without using hierarchy boards as Wondom did. In this way, you ca better see where the XOR operation is and what is feeding the mux operations. You can also see them using AUX ADC for a moving bandpass for each channel. Then you can see the mixers, including where they mixed the left and right channel before sending the signal forward. UGH! I mean, really? Fine if doing mono, but they took the time to design a logical left/right circuit to determine output. Why mix the signal? But, I digress.

 

And by multiplying, if a signal is not coming from the left, you multiply by 0, thereby getting 0, and vice versa. So, this is why you use multiply for some parts. I would recommend using the shift+F1 often when looking at what each toolbox item does. By highlighting the unit and clicking that, it brings you to the wiki webpage. You then drill down the links for the toolbox to read up on how the function works.


ReplyQuote

ElliottDesigns
(@elliottdesigns)
Reputable Member Moderator
Joined: 2 years ago
Posts: 254
 

@nixem MATLAB, yes, I've learned some through my engineering course at university

Elliott Dyson - Mechanical Engineering Student and 3D printing & Design Freelancer


ReplyQuote
Nixem
(@nixem)
Eminent Member Registered
Joined: 3 months ago
Posts: 23
 

@ajc9988 I need to digest this and play in SigmaStudio more. Thanks!


ajc9988 liked
ReplyQuote

Nixem
(@nixem)
Eminent Member Registered
Joined: 3 months ago
Posts: 23
 

@elliottdesigns @ajc9988

Have y'all used the Teensy 4.0 as USBi for the ADI boards?


ReplyQuote
Page 3 / 6

Newegg

Share:
%d bloggers like this: