DSP and Setting the Sampling Frequency in Arduino

10 years 6 months ago - 10 years 5 months ago #21 by JR

Rendering Error in layout Message/Item: array_keys(): Argument #1 ($array) must be of type array, null given. Please enable debug mode for more information.

Please Log in to join the conversation.

8 years 5 months ago - 8 years 5 months ago #396 by gajoo
Dear JR,

first of all, let me thank you for this interesting and educational project. It is a great inspiration for me!
I have one question for you and for users of pedalSHIELD. Is the Nyquist theorem really fulfilled?
In this case the sampling frequency is 44.1kHz. The highest frequency of sampled signal should be 22.05kHz. Yes we know that, BUT....the stompband behind this MAX frequency should be attenuated more than 70dB according to dynamic range of ADC and the AC analysis of pedalSHIELD input stage showed me that this condition isn't fulfilled.

Is my thinking wrong? Can you please explain this problem to me?

Please Log in to join the conversation.

8 years 5 months ago #397 by Ray
Hi, this is a very interesting question:

the stompband behind this MAX frequency should be attenuated more than 70dB according to dynamic range of ADC

This value from the theoretical SNR (signal-to-noise ratio) for an N-bit ADC: SNR=6.02√óN+1.76 dB
Arduino DUE ADCs are 12 bits so: SNR= 6.02*12 +1.76 = 74dB.
So we should attenuate 74dB over 20KHz to remove unwanted frequencies. This is usually done using the so called "anti-aliasing" filter.

In the input stage of pedalSHIELD there are some filters to remove unwanted high freqs:
- In ADC0, C2&R4 remove harmonics over 5.8KHZ at 20dB/dec.
- In ADC1, there are C5&R8 in addition to C2&R4 attenuating at 20dB/dec over 5.8KHz.

So there are several conclusions:
- ADC1 should "sound better" than ADC0.
- The input stage does not satisfy the theoretical SNR formula. The guitar signal does not have a very high content in high frequencies to be removed (most of the commercial digital pedals cut harmonics over 5KHz).
- In the purist hi-fi style, its important to satisfy this 70dB formula because sometimes you are listening to a piece of music with very subtle-low-volume violins where the ADCs are using only few bits but in pedalSHIELDa the input stage also adds gain, so the guitar signal is always way higher than the background noise so the ADCs are using most of their bits.
- There are some mods that you can add to the pedalSHIELD PCB to remove more highs; caps from R3, R8 and R9 to GND to create a fc around 5.8KHz.


At the output stage of pedalSHIELD there are also RC filters to remove freqs over 5.8KHz rolling-off frequencies at 40dB/dec: R13C9, R14C8 and R17C12
The following user(s) said Thank You: gajoo

Please Log in to join the conversation.

Time to create page: 0.067 seconds

Follow us

You can also follow us on:

facebook   google   instagram

pinterest   youtube   twitter