Solid State Guitar Amp Forum | DIY Guitar Amplifiers

Solid State Amplifiers => Preamps and Effects => Topic started by: jfetter on December 23, 2011, 12:50:48 PM

Title: dspic-codec
Post by: jfetter on December 23, 2011, 12:50:48 PM
I finally got the dspic preamp board done. Is any one else doing 16bit (_Q15) dsp?
It sounds great with no noise whatsoever. Running three filters now low,mid,hi.
Not much on the internet or from Microchip on pro-audio apps. Some of the old Analog Devices code works. The 16 bit works great for this app.

I need a good integer q15 reverb and a soft limiter.

This board is not a finished gadget. It is only for developing dsp code. Has six control voltages. Audio path is 100% digital.
Title: Re: dspic-codec
Post by: J M Fahey on December 23, 2011, 02:36:19 PM
Congratulations. :dbtu: :dbtu:
Title: Re: dspic-codec
Post by: joecool85 on December 29, 2011, 12:56:02 PM
Neat, I haven't done anything with digital signal processing at all yet and I'm thinking about getting into it once my son gets a little older and I have more time.  Any sound clips?  What are your plans for this?  Also, is this a board you designed?
Title: Re: dspic-codec
Post by: jfetter on December 29, 2011, 09:24:39 PM
Only plans are a pedal or head, maybe a combo. (I want to have something ready for production when the cheap imports go away). I will try to get a clip posted this weekend. Lost three days troubleshooting a nasty sound on one string. Turned out to be my headphone amp. I could not see it on scope so should have known. I'm now working on the WET-DRY mix having a lot of fun with it.
 Its using the dspic33fj256gp710, wolfson WM8731 and/or ti TLV320AIC codec. I have 4gb sd flash card for reverb tank. The flash should last several years with leveling(see microsoft "readyboost" http://blogs.msdn.com/b/tomarcher/archive/2006/04/14/576548.aspx ). DMA is utilized with the codec so processor has about 20% loading. The circuit itself is pretty simple. The codec takes care of anti-alias.
Schematic attached..
As mentioned I now do all work on OSX
Title: Re: dspic-codec
Post by: joecool85 on December 30, 2011, 09:12:09 AM
Only plans are a pedal or head, maybe a combo. (I want to have something ready for production when the cheap imports go away).

You're going to be waiting a while...
Title: Re: dspic-codec
Post by: J M Fahey on December 30, 2011, 09:18:11 AM
Agree.
Go ahead anyway, make your thing, and when ready try to sell it.
If the product really stands above the rest, or offers something others don´t, then you have what´s called your "selling point".
Meaning: you must be able to answer (truthfully) the Customer´s question: "why would I buy *yours* instead of something else?"
You must be able to provide a meaningful answer, or you won´t sell, imports or not.
Title: Re: dspic-codec
Post by: jfetter on December 30, 2011, 03:36:41 PM
I!m bettin devaluation of usd very soon. Getting speakers will be a problem so a head is probably the way to go.
Title: Re: dspic-codec
Post by: joecool85 on December 30, 2011, 04:04:58 PM
I!m bettin devaluation of usd very soon. Getting speakers will be a problem so a head is probably the way to go.

How is devaluation of the USD going to help get rid of imports?
Title: Re: dspic-codec
Post by: J M Fahey on December 30, 2011, 06:19:28 PM
Well, it will make them more expensive.
Problem is, with China minimum wages of U$ 0.39 an hour (official data for "foreign" (read=US capital) in the Shanghai area) anything they make will still be impossibly cheap.
An example:
http://youtu.be/W_YnaHNcISw

Anyway, study and experiment a lot and develop something which can´t be made by the millions by slaves and you´ll have a chance to sell.
Good luck.
Title: Re: dspic-codec
Post by: jfetter on December 31, 2011, 10:58:40 AM
Here is an example of a one knob super tone control. aka STONE control...
The control voltage is reduced to 64 discrete points and the tone MACs use the multipliers as "gain" for lo mid and hi. The center position gives an enormous scoop. It sounds very musical.
Adjustments can be made for LOW and HI too. What I like is the soldering iron is never plugged in.

volatile fractional STONE[64][3]={
    {Q15(0.570),  Q15(0.1),   Q15(0.235)},   //00
    {Q15(0.560),  Q15(0.1),   Q15(0.205)},   //01
    {Q15(0.545),  Q15(0.1),   Q15(0.195)},   //02
    {Q15(0.540),  Q15(0.1),   Q15(0.175)},   //03
    {Q15(0.535),  Q15(0.1),   Q15(0.165)},   //04
    {Q15(0.530),  Q15(0.1),   Q15(0.170)},   //05
    {Q15(0.525),  Q15(0.1),   Q15(0.175)},   //06
    {Q15(0.520),  Q15(0.1),   Q15(0.180)},   //07
    {Q15(0.515),  Q15(0.1),   Q15(0.185)},   //08
    {Q15(0.510),  Q15(0.1),   Q15(0.190)},   //09
    {Q15(0.505),  Q15(0.1),   Q15(0.195)},   //10
    {Q15(0.500),  Q15(0.1),   Q15(0.200)},   //11
    {Q15(0.495),  Q15(0.1),   Q15(0.205)},   //12
    {Q15(0.490),  Q15(0.1),   Q15(0.210)},   //13
    {Q15(0.485),  Q15(0.1),   Q15(0.215)},   //14
    {Q15(0.480),  Q15(0.1),   Q15(0.220)},   //15

    {Q15(0.475),  Q15(0.1),   Q15(0.225)},   //00
    {Q15(0.470),  Q15(0.1),   Q15(0.230)},   //01
    {Q15(0.465),  Q15(0.1),   Q15(0.235)},   //02
    {Q15(0.460),  Q15(0.1),   Q15(0.240)},   //03
    {Q15(0.455),  Q15(0.1),   Q15(0.245)},   //04
    {Q15(0.450),  Q15(0.1),   Q15(0.250)},   //05
    {Q15(0.445),  Q15(0.1),   Q15(0.255)},   //06
    {Q15(0.440),  Q15(0.1),   Q15(0.260)},   //07
    {Q15(0.435),  Q15(0.1),   Q15(0.265)},   //08
    {Q15(0.430),  Q15(0.1),   Q15(0.270)},   //09
    {Q15(0.425),  Q15(0.05),   Q15(0.275)},   //10
    {Q15(0.420),  Q15(0.05),   Q15(0.280)},   //11
    {Q15(0.415),  Q15(0.025),   Q15(0.285)},   //12
    {Q15(0.410),  Q15(0.025),   Q15(0.290)},   //13
    {Q15(0.405),  Q15(0.001),   Q15(0.295)},   //14
    {Q15(0.400),  Q15(0.001),   Q15(0.300)},   //15

    {Q15(0.395),  Q15(0.001),   Q15(0.305)},   //00 mid
    {Q15(0.390),  Q15(0.001),   Q15(0.310)},   //01
    {Q15(0.385),  Q15(0.025),   Q15(0.315)},   //02
    {Q15(0.380),  Q15(0.025),   Q15(0.320)},   //03
    {Q15(0.375),  Q15(0.05),   Q15(0.325)},   //04
    {Q15(0.370),  Q15(0.05),   Q15(0.330)},   //05
    {Q15(0.365),  Q15(0.1),   Q15(0.335)},   //06
    {Q15(0.360),  Q15(0.1),   Q15(0.340)},   //07
    {Q15(0.355),  Q15(0.1),   Q15(0.345)},   //08
    {Q15(0.350),  Q15(0.1),   Q15(0.350)},   //09
    {Q15(0.345),  Q15(0.1),   Q15(0.355)},   //10
    {Q15(0.340),  Q15(0.1),   Q15(0.360)},   //11
    {Q15(0.335),  Q15(0.1),   Q15(0.365)},   //12
    {Q15(0.330),  Q15(0.1),   Q15(0.370)},   //13
    {Q15(0.325),  Q15(0.1),   Q15(0.375)},   //14
    {Q15(0.320),  Q15(0.1),   Q15(0.380)},   //15

    {Q15(0.315),  Q15(0.1),   Q15(0.385)},   //00
    {Q15(0.310),  Q15(0.1),   Q15(0.390)},   //01
    {Q15(0.305),  Q15(0.1),   Q15(0.395)},   //02
    {Q15(0.300),  Q15(0.1),   Q15(0.400)},   //03
    {Q15(0.295),  Q15(0.1),   Q15(0.405)},   //04
    {Q15(0.290),  Q15(0.1),   Q15(0.410)},   //05
    {Q15(0.285),  Q15(0.1),   Q15(0.415)},   //06
    {Q15(0.280),  Q15(0.1),   Q15(0.420)},   //07
    {Q15(0.275),  Q15(0.1),   Q15(0.425)},   //08
    {Q15(0.270),  Q15(0.1),   Q15(0.430)},   //09
    {Q15(0.265),  Q15(0.1),   Q15(0.435)},   //10
    {Q15(0.260),  Q15(0.1),   Q15(0.440)},   //11
    {Q15(0.275),  Q15(0.1),   Q15(0.445)},   //12
    {Q15(0.285),  Q15(0.1),   Q15(0.460)},   //13
    {Q15(0.295),  Q15(0.1),   Q15(0.470)},   //14
    {Q15(0.325),  Q15(0.1),   Q15(0.480)}   //15    16 X 4=64
};

then in the DMA handler
// do the macs
        for(i=0; i<16;i++){
        ACMA = __builtin_clr();
        ACMA = __builtin_mac(ACMA,LOW, lowpassout, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
        ACMA = __builtin_mac(ACMA,MID, midpassout, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
        ACMA = __builtin_mac(ACMA,HI, hipassout, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
        sumadd = __builtin_sacr(ACMA,-3);
        }
Title: Re: dspic-codec
Post by: J M Fahey on December 31, 2011, 11:42:12 AM
Cool !!!
Now I´ll type it in my Commodore 64 and will give it a try. ;)

Bad jokes aside, congratulationson your experimenting.  :tu:
Now we need some MP3s showing the results ;)
Title: Re: dspic-codec
Post by: joecool85 on January 04, 2012, 09:19:53 AM
Cool  :tu:

As a programmer, I applaud the effort!  Now if only there was a way to use PHP in stompboxes...