Mosaic
Well-Known Member
Hi All:
I am back at my sound localization project. Without getting into FFT I want to sample 4 electret mics spaced about 10cm apart in a square, simultaneously, in order to try to assess the sound propagation direction among them.
Some complexity ahead!
The approach: using 4 x 12F675 synced 20Mhz PICs to sample the 4 x mics and a 16F1826 'master'.
1) Each 12f675 (20Mhz) samples audio (OPA amplified) @ 10Khz, 8 bits. Assess a peak inflection based on two consecutive declining amplitude samples. There can be several of these during any 8msec period at higher audio frequencies. The largest is reported to the main processor.
2) Every 8 msecs (80 samples) they bitbang a 16 bit timestamp and an 8 bit waveform (max) peak amplitude. Each sampling PIC delays its transmisson by 0,2,4 or 6 msecs for transmission syncing. Thus the 24 bits of data must transmit in under 2 millisec.
The time stamp is when the peak amplitude of the waveform occurs in a fixed 48mS period, after which the timestamp is reset. A zero amplitude implies a peak is not detected in the last 8ms sampled. Therefore the waveform is still rising or falling => frequency < 125hz
By assessing a single 'peak' every 8mS the amount of data processing is reduced.
The 16F1826 (20Mhz) main processor then looks at the stored samples over the most recent rolling 48ms period (6, 8mS periods) to identify the time differences in the peaks and determines which quadrant the sound source is located in. 48mS should cover frequencies down to just over 20Hz. Prescaling (x4) the 16 bit Tmr1 instruction clock will permit an overflow @ about 52ms. This gives the highest resolution (0.8 uS/tick) time stamp for the 48mS period.
Main processor RAM data table requirements is 3 bytes x 4 samples x 6 periods = 72. This fits within a 80 byte bank.
Does this sound reasonable?
thx Ancel
I am back at my sound localization project. Without getting into FFT I want to sample 4 electret mics spaced about 10cm apart in a square, simultaneously, in order to try to assess the sound propagation direction among them.
Some complexity ahead!
The approach: using 4 x 12F675 synced 20Mhz PICs to sample the 4 x mics and a 16F1826 'master'.
1) Each 12f675 (20Mhz) samples audio (OPA amplified) @ 10Khz, 8 bits. Assess a peak inflection based on two consecutive declining amplitude samples. There can be several of these during any 8msec period at higher audio frequencies. The largest is reported to the main processor.
2) Every 8 msecs (80 samples) they bitbang a 16 bit timestamp and an 8 bit waveform (max) peak amplitude. Each sampling PIC delays its transmisson by 0,2,4 or 6 msecs for transmission syncing. Thus the 24 bits of data must transmit in under 2 millisec.
The time stamp is when the peak amplitude of the waveform occurs in a fixed 48mS period, after which the timestamp is reset. A zero amplitude implies a peak is not detected in the last 8ms sampled. Therefore the waveform is still rising or falling => frequency < 125hz
By assessing a single 'peak' every 8mS the amount of data processing is reduced.
The 16F1826 (20Mhz) main processor then looks at the stored samples over the most recent rolling 48ms period (6, 8mS periods) to identify the time differences in the peaks and determines which quadrant the sound source is located in. 48mS should cover frequencies down to just over 20Hz. Prescaling (x4) the 16 bit Tmr1 instruction clock will permit an overflow @ about 52ms. This gives the highest resolution (0.8 uS/tick) time stamp for the 48mS period.
Main processor RAM data table requirements is 3 bytes x 4 samples x 6 periods = 72. This fits within a 80 byte bank.
Does this sound reasonable?
thx Ancel
Last edited: