DIY DSP crossover implemented in C on PIC32MZ

@googlyone do you have experience in developing active crossover based on ADSP21489 using ADC and DAC separate boards instead of AD1939
I have not used the ADSP21489, but imagine it is noting wildly unusual. In terms of different ADC and DACS, I have used a bunch of them. Once you have sorted the configuration things are usually quite transparent.
 
@googlyone did you use your own code for the DSP functions or code from Harmony?

I’m working on some music related projects and want to make my own DSP functions and I’m trying to understand how to call the DSP related assembly instructions in C.

I know XC32 is based upon or related to GCC.
There are only a few "DSP" instructions in the PIC32MZ. The principal one is the double Multiply - ADD function which you will find in the IIR filter section. This saves a bunch of cycles as the PIC does this (well I cant remember how many cycles it takes) but a lot faster than your garden variety PIC..

If you ca get yourself an ADC / DSP of some sort / DAC up and running you will find that playing with the signal processing in between is really surprisingly easy - and if you are of the right mindset - fun.

Give it a try!
 
My idea is too make DSP like https://www.analog.com/en/design-ce...ion-boards-kits/21489-ezlite.html#eb-overview
,but I want to use ADC and DAC separate boards instead of AD1939 so I will have more control on quality/features and number of DAC I will use . I want to use it for active crossover 1way up to 4 ways, so for 1way I will use 1 DAC board, for 4 way I will use 4 DAC boards. How difficult is to do that as I need to redesign Analog Device PCB board?
 
There is no question you could do that.

The ADSP processor will definitely have the horsepower to do a four way XO. You will be paying a massive premium for the development board though. The PIC Micro based approach ended up in an Australian magazine here: https://www.siliconchip.com.au/Issue/2019/May

This uses CS4398 DACs and and CS5381 ADC, which are pretty damn good devices, if not the latest. (actually measuring the THD of these is hard work indeed - I have tried).

The code for this did implemented a two way, with some fiddling you could go three way by adding the DSP code and an extra interface for a DAC. There is heaps of spare processing time. Silicon Chip sell PCB's and all the source code is available on their site (or from me) so if you wanted to get your hands dirty it is all there to play with.
 
googlyone, is sources available somewhere to take a look?

I am in the process of eventually making a 6 channel car amplifier with active crossover (front low +mid/high, rear full range) and equalizers for each channel, + master bass/mid/tre/volume/balance/fader controlled over a CAN bus, and since it will be my first DSP project, it is a little hard for me to decide if there's single STM32 ot PIC32 device that will be enough to do the whole job. A am also unaware if I use more expensive dedicated DSP from ADI for example, is there a free IDE/programming languages available for them? I have more or less rich experience with PIC32MX, some with STM32F1, so I am aware of what is needed to run them, but zero experience with more serious/expensive DSPs. Since the project is only for fun, I can afford pretty expensive DSP chip(s), but I just cannot decide if it's woth it.

The project will eventually consist of +/-28V SMPS, 6xTDA7294 (or LM3886 if they become available somewhere) and this active equzliser+crossover. The idea is not to create power monster, but amplifier which is usable in it's whole power output upto 50W per channel with low distortion.
 
Hi. The siurce code certainly is available. A variant of this was published in an australian magazine, silicon chip. The source etc is all free for download from their site and at least 2 people i know of have it running.

They do charge to download the articles, but there is not a whole lot there that is not on this blog.

The compiler is microchip c32, and uses the microchip mplab development environment. All the code is in C. The dev environment and compiler are all free downloads from microchip too.

You would need to optimise the code to get six channels running with all the stuff i loaded in there. Possible but i suspect you would as a minimum need to get the compiler optimisations turned on, and that requires the paid version of the compiler.

For the 5 or 10 bucks a micro costs you could run two processors.

But to be totally honest if i was you, i would play with this then go build an ADAU1442 or similar (which i have). This is still non trivial but they are made for this job.

Your best bet for readonably quick startup is to grab a minidsp board and adc dac board and use that. You can still toll your own code (the low end ones are ADAU chips anyway).

Take a look at the above stuff and i am happy to talk and help.
 
The problem with ADAUs is that... there's only ADAU1701 in stock at the moment (farnell, mouser, digikey). I tried making it with ADAU1701 and I must again use 2 pcs of them. One is at the edge (505 out of 512 instructions) of being enough to do 3-band tone control, 1 crossover, 3 parametric equalizers with 4 filters each, 2 volume controls and 3 soft clippers for one mono input and 3 mono outputs at 96kHz sampling rate. The good (or cheap) thing is - they come with ADCs and DACs in them (although not that good), so 2xADAU1701 + 1 cheap MCU to control them will do the job, but after all, this is not a tight budget project, but fun project. I would love to do the job with ADAU1452, but there's nowere to buy them at the moment, except Aliexpress, but I hate buying chips from there.
...and, I do have 10 x PIC32MZ2048EFH144 + 10 x PIC32MZ2048EFH064 in my drawer. :) Yes, these are of the early ones with some bugs, but none of the bugs affects their performance in this particular project.
I will try to find the source to take a look, so thank you for the help. From what I saw in this thread, one PIC32MZ will be enough for what ADAU1701 is doing, so I may end up with 2 PIC32MZ-s doing the job in parallel or in series. instead. OR, ADAU1451 will be available on february on mouser, or at least they claim so. :)
Anyway, I will let you know when I start making the project. It will also be public ot github.
 
this will definitely be a project! The ADC and DAC designs are not that hard, but if you take a hifi route will become a lot more expensive than simple ADAU1701 etc.

I did really like the ability to code the audio processing. Once you have the data in the micro, it is all there and reasonably straight forward to implement all manner of effects.

If you cant get hold of the code write me and I will see what I can dig up. I have code for controlling the ADAU family of DSPs as well as hand coded DSP for PIC. Though I warn you, I am a hardware engineer so the code is somewhat brutal.
 
Your crossover is very nice. I made a stereo RIAA preamp with PIC32MZ and IIR filter. All calculation are in double float (MCU have fpu unit) Sampling frequency is 96kHz. This is first version with Microchip kit. Now i have my designed kit with ADC/DAC. Your idea with incereasing of sampling frequency without fraction is genial. All calculation you making in integer ?

248369387_4519989621391367_1449561432185326023_n.jpg
248390194_4519989848058011_8181020258083322755_n.jpg