Jump to content
  • 0

NEXYS 4 DDR Microphone Analysis


JhnWstbrk

Question

I want to play a steady note into the microphone on my NEXYS 4 board, and display what note that is on the SSEG display. Using SystemVerilog in Vivado, I have been stuck on trying to determine frequency from the microphone's PDM output for quite some time now. I have slowly been working through first converting this PDM signal to PCM, and then was planning on performing an FFT on this PCM data. My PDM->PCM conversion is being handled by a CIC Decimation Filter. Is there an easier way to do this? I recently found that I could potentially FFT a PWM converted signal from the PDM data, but I have spent so much time going the PCM route that I am afraid to switch paths now. I have mostly been working from this example: PDM Microphone to PCM Decimation for converting to PCM data, and these GitHub's: Nexys4FFTDemoFreeform Production of Gorgeous Audio for performing an FFT on the PCM data. I have not found the Nexys 4 GPIO Demo to be much help, as I wish to store the mic data, and not immediately output it. I am afraid I still don't know enough about Digital Signal Processing to accomplish what I am trying to do. 

 

Once past the frequency determining part, I am building off of my already-made system from the book FPGA Prototyping by SystemVerilog Examples by Pong Chu to handle the note calculation and SSEG display on Vitis in C++.

 

If the PDM->PCM->FFT route is the best way to go, here is a waveform I have generated to test my pdm_2_pcm module, but I don't think the PCM output is correct. Any help on what the PCM signal should look like would be appreciated.

image.thumb.png.9e0fabb255497dc1045c462713f723e8.png

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 1

You can convert PDM to PCM before the FFT or after.  That's an engineering choice.  Both will work.  Often the PCM gives you lower logic, and more headroom for the FFT--but that may require more engineering than what you are up to at present.

Try this: Simulate and verify every component individually.  Dump the outputs of the component to a text file that you can read and verify with Matlab.  Make sure you get what you want along the way.

Just as a heads up, frequency estimation is often more difficult than just taking an FFT of an incoming waveform.  I've done it.  The FFT approach was the first one I tried.  Depending on the details of the sample rate and the FFT size, you may have too many bins or not enough.  You are also very likely going to be distracted by harmonics.  If you've never "seen" the output of an FFT given real life signals, you should do that first.  It's very instructive.  The "best" way to do that is often via a scrolling raster, but ... video requires memory, often external memory, and ... that's likely to be a bit beyond a beginner's first project.  For now, perhaps you should consider capturing data and running it through the algorithm you'd like on your PC (matlab?  Octave?) to see what real-life data looks like.  Perhaps you might even wish to read audio from your computer's sound card, to get an understanding for how rich real data sets can be.  Unfortunately, that 7Segment display isn't going to give you enough feedback to know how to debug an algorithm like this, applied to so rich a data set as the real world.  You will need software help along the way.

Dan

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...