1
\$\begingroup\$

I'm trying to design a guitar pedal effect, a looper to be precise. My idea is to use the PIC24FJ128GC010 which has a 16 bit ADC, in order to have a good audio quality. Since my idea is to convert, register and then save the sound in an external SRAM module, I'm trying to find a SRAM module which can fit my project. I've made some calculus but I'm not sure that they are correct: Since the bandwidth of the guitar frequencies goes approximately from 80Hz to 15KHz, the sampling frequency should be around 30KHz (Nyquist-Shannon theorem), so if I have a 16 bit ADC for example for a minute of sampling I will have: 30'000 Hz *60 s = 1'800'000 samples/min * 16 bit = 28'800'000 bit/min = 3.6MB/min Am I right? Am I missing something? I accept every suggestion, also about the choice of the SRAM. Thank you.

\$\endgroup\$
  • \$\begingroup\$ Why does your effect require storing a minute of continuous audio? \$\endgroup\$ – Dave Tweed Oct 21 '17 at 16:03
  • \$\begingroup\$ Because since it is a looper it has to record a signal for a certain amount of time, and then reproduce it continuosly. I was doing the calculus taking into account the worst case possible (the longest time of recording decided by me). \$\endgroup\$ – Luca Daidone Oct 21 '17 at 16:15
3
\$\begingroup\$

Why use PIC24+sram when the newish PIC32MZ DA series have 32MB of internal/stacked DDR? TI has some nice adc codecs that mesh well with i2s. While I understand trying to keep it under one roof, I think it is better to add an audio adc rather than sram. Typical micro adc's aren't really geared toward audio anyway.

I'd guess that by the time you find 4mb of sram you'll about be at the cost of the DA series, especially if you figure the extra pcb layout time and layer count.

The current errata does limit ddr to 0-70C, but 32MB is real nice, it opens up lots of possibilities.

\$\endgroup\$
  • \$\begingroup\$ oh, nice! yeah, that's definitely capable embedded DSP. \$\endgroup\$ – Marcus Müller Oct 21 '17 at 18:25
0
\$\begingroup\$

\$3\cdot 10^4 \frac{\text S}{\text s} \,\cdot \, 6\cdot10^1\,\text{s}\,\cdot\,1.6\cdot10^1\frac{\text{bit}}{ \text{S}}=2.88\cdot 10^7 \,\text{bit}=3.6\,\text{MB}\$, so that's right.

Why use external SRAM? That will require you to put a high load on the external memory interface, and it's not very cheap, either.

There's enough microcontrollers with enough integrated RAM for this purpose (they're typically called DSPs, digital signal processors, which describes your application very well. However, these will probably come with way, way more CPU power than you need, at costs significantly above high-perf ARM application processors – see below).
Your choice of a 16bit microcontroller is very ill-advised, considering that doesn't even allow you to address that much RAM directly.

So, a simple raspberry Pi with some I²S sound interface would do this pretty well, if you run the signal processing at a high priority (or bare-metal, which isn't actually harder then writing code for a smaller microcontroller).

So, pick something 32bit; again, I'd recommend just using a single-board computer, and writing Linux software; audio is pretty "boring" for processors that capable, and unless you're after below-single-sample-period latencies, you can achieve sufficiently low latencies by configuring the normal kernel drivers accordingly.

\$\endgroup\$
  • \$\begingroup\$ Isn't the list of DSP's or microcontrollers with >3.6mb of internal ram rather short? \$\endgroup\$ – Erik Friesen Oct 21 '17 at 14:42
  • \$\begingroup\$ @ErikFriesen from the top of my head, several TI KeyStones \$\endgroup\$ – Marcus Müller Oct 21 '17 at 14:47
  • \$\begingroup\$ I hadn't seen those. Power supply design and PCB Layout for those will not be trivial, but that is a different issue I suppose. \$\endgroup\$ – Erik Friesen Oct 21 '17 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.