Pic driven digital audio delay


Closed Thread
Results 1 to 13 of 13
  1. #1
    skimask's Avatar
    skimask Guest

    Default Pic driven digital audio delay

    Got an audio project...quick description:
    Using 8 PIC18F2620's, 4 per channel, 2 channels, running @ 40mhz
    Twin 16bit ADC's on the left/right inputs, sampling @ 44.1khz.
    Twin 16bit DAC's on the left/right outputs, 44.1khz rate.

    One master PIC sending out pulses at 44.1khz (actually 44.247khz, TMR0 overflow driven)...1st PIC in line samples reads ADC, stores audio, shifts it down the line until the last PIC, last PIC in line sends out 16bit audio to DAC.

    Each of these PICs, except for the master timing PIC, is basically a 3.5K FIFO buffer providing a total delay of about 66.6ms.

    This is all mounted on a spectrum analyzer and neccessary because it takes the spectrum analyzer PIC that amount of time to process the audio data. And using this digital audio delay keeps it all in sync.

    Any easier way to do this, short using a single PIC and an external ram chip (or a PIC with a load of ram, I can wish for it).

  2. #2
    Join Date
    Oct 2005
    Location
    Loveland CO USA
    Posts
    83


    Did you find this post helpful? Yes | No

    Default audio delay

    Think about DSPs or ARM or FPGA.
    DSP are built to do this job.
    An ARM processor is much faster and has large amounts of RAM.
    With an FPGA I have done this with video not audio.

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ronsimpson View Post
    Think about DSPs or ARM or FPGA.
    DSP are built to do this job.
    An ARM processor is much faster and has large amounts of RAM.
    With an FPGA I have done this with video not audio.
    Sure would...I'd prefer to stay with PICs. ARMs, FPGAs mean more programmers, software, tools, etc. to buy. Not that it's a bad thing! I've been meaning to get into FPGA/Programmable logic/etc, don't really know where to start, or even if they're for me (meaning do I really need them?).

  4. #4
    Join Date
    Oct 2005
    Location
    Loveland CO USA
    Posts
    83


    Did you find this post helpful? Yes | No

    Default audio delay

    Altera has free software for their FPGA. It will open up a new world to you.

    http://www.hbbrbasic.com here is a BASIC compiler for ARMs. You almost have to use LPC2000 type of ARMs or AT91SAM7. The price is right! You will get 50MIPs and RAM! 10X speed!

    I do not know of DSP-BASIC. DSP is the right choice.

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    PIC24 or DsPIC should do the trick... and maybe 18F...

    What you need to do exactly?

    From what i feel, there's some dedicated IC to do what's you're after that may reduce the development time and maybe the overall cost.

    If my feeling is good, even a 12F would do the job
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    What you need to do exactly?
    I built a spectrum analyzer using a pair of 18F4620's, one each for left and right channels. The problem is, the math involved in doing the FFT for the display takes about 64ms, another 6ms to display it on a graphic LCD, and about another 1ms to do housekeeping (all the while I'm doing the sampling). So, by the time the analyzed audio gets to the display, it's 71+ ms old. Looks a bit goofy being just that far out of sync. Actually, it looks fine if my display and speakers are roughly 25 meters away, I see the display immediately and the sound takes roughly 71ms to get to me .

    Right now, I'm using the setup described in post#1:
    2 - 16bit ADCs
    2 - 16 bit DACs
    2 - PIC18F4620 doing 256 point FFT spectrum analyzing math
    8 - PIC18F4620s doing circular FIFO type audio data buffering/shifting (2 channels x 4 PICs) interconnected to each other thru a serial link, 1st one in line connected to the ADC, last one in line connected to the DAC.
    1 - PIC18F2620 doing master timing duties, keeping all the audio data shifting in sync.

    The 4 PICs give me a total of about 14K of ram to do buffering with. 44.1khz, stereo, 16 bit sampled audio data is about 176KB/sec, ~70ms is about 14KB, give or take, that's why I use all this to get what I need. The board is ugly (it's on a solderless breadboard), but it works.

    12F? You know of a 12F with 14K in it?

    Basically I guess I need a 'bucket brigade' type chip...again, with 14K of SRAM...
    Last edited by skimask; - 18th April 2007 at 17:34.

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    So why not using a dedicated Audio delay IC instead? Some are Home theater dedicated.. but who will know?

    Ti do some. A PIC/ad/memory/DA plah plah would be just too bad for that kind of task... more distortion than good results...

    If you need only a few Spectrum bands, have a look to TDA7416

    Sorry but, you make it much complicated that it should be...and you scrap the possible modern sound quality... wich is already soooo bad

    Yeah i'm an audio purist

    you could still by an audio delay processor
    Lexicon, Alesis, Yamaha, etc etc etc
    Last edited by mister_e; - 18th April 2007 at 20:58.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    So why not using a dedicated Audio delay IC instead? Some are Home theater dedicated.. but who will know?
    I have to find one first, something in less than a BGA9000 pin package! And this project is just a 'gee-whiz' box that goes in between my mp3 player and the stereo itself. Eventually, I'm going to tie it into a LOAD of leds for the spectrum analyzer instead of the graphic LCD.

    Ti do some. A PIC/ad/memory/DA plah plah would be just too bad for that kind of task... more distortion than good results...
    As it is, the output sounds pretty good. I don't overload the input...and if anything, I introduce noise rather than distortion (at least not the clipping kind of distortion). My sample rate on the A/D and D/A is 44.2khz (because it's a good round number that the master timing PIC produces), I know higher is better, but that would mean more need for memory in the middle.

    [QUOTE}If you need only a few Spectrum bands, have a look to TDA7416[/QUOTE]
    I like my 128 band per channel spectrum analyzer!

    Sorry but, you make it much complicated that it should be...and you scrap the possible modern sound quality... wich is already soooo bad
    Yeah i'm an audio purist
    Probably, but if we didn't overcomplicate things, we wouldn't be here!

    you could still by an audio delay processor
    Lexicon, Alesis, Yamaha, etc etc etc
    What I've got right now is fairly compact (about the size of a VCR tape) and runs off a battery pack. An external box is not in my 'Master Plan',

  9. #9
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Let's suggest an oldy but still on the market....TAS3103 could be a great suggestion...

    It's the first that spring to mind. Worth to look at something like that.

    I don't remind the whole option it provide.. but i remember it cost about 10$ USD in a 39TSSOP package, something even my dog can solder on a board


    TI TAS DSPs are usually nice. I used them a lot.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  10. #10
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Let's suggest an oldy but still on the market....TAS3103 could be a great suggestion...

    It's the first that spring to mind. Worth to look at something like that.

    I don't remind the whole option it provide.. but i remember it cost about 10$ USD in a 39TSSOP package, something even my dog can solder on a board


    TI TAS DSPs are usually nice. I used them a lot.
    I'll check into them. They might be the ticket, as long as there isn't a steep learning curve and a load of programming to figure out. I guess I just want the single chip, everything is already done, type chip.

  11. #11
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    They're usually easy to use. If you want to use/set the Biquad filter... it's another story... but doable.

    They just need a I2C bus, and few commands... no big deal... this is why i told you that maybe a 12F could be enough..
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  12. #12
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    mmm... those new Analog Device ADAU1701, ADAU1702, ADAU1401 look pretty nice too... but brand new too.

    http://www.analog.com/en/subCat/0,28...0%255F,00.html

    i'll ask for samples... i've just found an application for them ... mmmm
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  13. #13
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default One more

    Ti Tpa5050, Tpa5051
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. 16F628A - Stops if release power switch.
    By dene12 in forum General
    Replies: 16
    Last Post: - 14th February 2009, 07:57
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  3. Digital audio delay
    By RussMartin in forum Schematics
    Replies: 1
    Last Post: - 7th July 2008, 20:55
  4. assembly in Pic
    By lerameur in forum Off Topic
    Replies: 11
    Last Post: - 1st May 2008, 20:06
  5. Problem with saving to EEPROM...
    By Tear in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 1st July 2005, 00:10

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts