IMHO, a software heterodyne is overkill, if you are building a toy (which is what this sounds like); you can just double the output sampling rate and reuse sub-phoneme sized chunks of audio data. You'll have to experiment with what size chunks to recycle for best results, or better yet, make it user-selectable, and you've got another free sound effect. You'll get some warbling, etc.; if you really want to minimize that, and avoid clipping artifacts, you can try this technique: Buffer: [ | ] 0 N/2 N 1. Play 0 to N (FORWARD) at SRate*2. 2. Play N to N/2 (REVERSE) at SRate*2. 3. Play N/2 to N (FORWARD) at SRate*2. 4. Lather, rinse, repeat. What this does is avoid the sharp discontinuities in waveforms you'd normally get when picking arbitrary loop points; you're just going back and forth over the same smooth(er) curve. Experiment with differrent buffer sizes; it'll probably sound best for fairly small buffers. You'll need to double-buffer, obviously (one buffer to record, one to playback, then swap; use a scope to check for discontinuities due to off-by-one errors with the buffers, those ALWAYS seem to crop up). If you're familiar with audio programming on a PC, you can experiment there, first. If not, just grab an eval version of CoolEdit, sample some stuff in raw signed 8-bit at whatever rate you're going to use, save it to disk, write an app to apply the above-described method and produce an output file, load that back into CoolEdit and play it back at twice the sampling rate. Fiddle with your algorithm until you like it, since it'll be easier to tweak on the PC. If you want a low-processing way to do silence detection, let a capacitor charge off your audio output through a resistor, and also drain through a resistor. Connect that same cap to the base on a transistor, and have it switch an input pin on the PIC. Voila, you have a "silence detected" input. You can even swap in varistors if you want to be able to adjust the silence thresholds (level and time), giving you a nice, cheap, intuitive user- interface. This is kind of the analog equivilant of running a continuous average over a sample buffer and comparing it to your cutoff, which would be the way you'd normally do it in software. Half the fun of these things is the neat way you can mix and match digital and analog solutions to subproblems. (The other half is how freakin' CHEAP they are! =] ) But if you're dead-set on doing it the "right" way... I don't know; perhaps one of the Scenix 100 MHz parts could handle such a task? By the way, to deal with a smaller amount of data, consider using ADPCM compression on-the-fly-- if you have enough cycles left over. Cheers, Matt Heck Software/Firmware Development Consultant nuclearmartini@hotmail.com -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Olin Lathrop Sent: Thursday, September 27, 2001 9:23 AM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: > I need to create the following application: > - Delayed auditory feedback (1) > - Frequency shifted auditory feedback (2) > > (1) when you speak, you listen to your own voice with a delay (scalable to 1 > to 500 ms) > (2) you listen to your voice without a delay but the pitch has changed (-1/2, > -1, +1/2, +1 octave) > > the (1) and (2) may be used same time or separately. > > And when no voice is detected a sound of 125 Hz is generated (the suond can >> be generated by a 555 timer but if the PIC can do it, please let me know) > >This is a bit much for a PIC. For starters, you need to sample voice around >8KHz. This means you need to store at least 4000 samples to get the 1/2 >second delay. A PIC could do this with external memory. The best way to >change the pitch is probably a software heterodyne. This is definitely >beyond a PIC. You need to a DSP. > > >******************************************************************** >Olin Lathrop, embedded systems consultant in Littleton Massachusetts >(978) 742-9014, olin@embedinc.com, http://www.embedinc.com > >-- >http://www.piclist.com#nomail Going offline? Don't AutoReply us! >email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body