Goshik92 / FFTVisualizer

This project demonstrates DSP capabilities of Terasic DE2-115
27 stars 12 forks source link

Frequency detection #1

Open ntdslay opened 7 months ago

ntdslay commented 7 months ago

Dear sir/mam I want to build a pitch detector using codec on de2-115. I have initialized WM8731, configured it to communicate with microphone and built i2s protocol to get the data from microphone, But i don't know to how to get the frequency of the voice. Can you suggest me some ways to do it. Many thanks

Goshik92 commented 7 months ago

@ntdslay, could elaborate on what kind of pitch detector you are trying to build? A you planning to display (1) a full FFT graph or (2) just the dominant frequency? For (1) you can use this repo as reference implementation. For (2) you can try simpler solutions such as The Goertzel Algorithm. You would need a separate instance of the algorithm for each frequency you want to detect. You could obtain the amplitudes of those frequencies and display the frequency with the strongest amplitude.

ntdslay commented 7 months ago

@Goshik92 Just a normal pitch detector on FPGA broad for my thesis project sir. Like you say a word then it shows 'A3' or 'A#3'... or similar notes. But the thing i'm confused most is that I got the digital number of the output ADC. and then I use an autocorrelation pitch detection algorithm to calculate that number into a frequency number??

Goshik92 commented 7 months ago

@ntdslay, the autocorrelation method is also an option, but I would make sure it works well for your signal by trying it in a Python script before implementing it in FPGA.

ntdslay commented 5 months ago

@Goshik92 yes sir, I will try. But I am confused about the quantized data. I observe it on signal tap and it shows a sequence of data, is it a floating point or something else (in datasheet it states that: 'The data is signed 2’s complement') and how many bits represent fractions and so on...? . I don't know the full scale range of that adc neither.... can you help me with that? many thanks