cancel
Showing results for 
Search instead for 
Did you mean: 

MA pointers pointing to something else when sampling audio.

JRatt.2
Associate II

Im trying to build a guitar pedal on a STM32F446RE. 'SoundIN' is assigned to a pointer that is assigned to address value of the adc samples. 'SoundOUT' is half of soundIN (Just a test to see if works). However, output pointer '*outPoint' is showing a different value. When I input a sine wave of say 2Vpp, I get the exact same signal out. Shouldn't I be getting 1Vpp at the output ?


_legacyfs_online_stmicro_images_0693W00000bhsh3QAA.pngFigure 1 shows the debugger output. Shouldn't 'outPoint' be a similar value to 'soundOUT' ?


_legacyfs_online_stmicro_images_0693W00000bhsiBQAQ.pngFigure 2 shows my double buffering code.

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
4 REPLIES 4
KnarfB
Principal III

Fig. 2 shows the conversion of a single audio sample, not a buffer. I would expect a for loop somewhere.

When the debugger stops at the green line, the assignment to *outPoint was not yet executed, and Fig. 1 shows the previous value at that address.

hth

KnarfB

JRatt.2
Associate II

Thanks for your answer. Something like this ?


_legacyfs_online_stmicro_images_0693W00000bhtOWQAY.png

KnarfB
Principal III

Well, not completely. This is more about C programming. You might want to check/follow Phil's Lab video, e.g. https://youtu.be/zlGSxZGwj-E?t=971

hth

KnarfB

I tried using Phil's method but it also didn't work.

This is my new code. It still doesn't work, unfortunately.


_legacyfs_online_stmicro_images_0693W00000bhxr8QAA.png