Presentation is loading. Please wait.

Presentation is loading. Please wait.

PITCH DETECTION Shaan Patel HoangMinh Nguyen Richard King.

Similar presentations


Presentation on theme: "PITCH DETECTION Shaan Patel HoangMinh Nguyen Richard King."— Presentation transcript:

1 PITCH DETECTION Shaan Patel HoangMinh Nguyen Richard King

2 Introduction Design and implement a program on the DSP that would determine the pitch of the input signal Distinguish between Male and Female voices Male Pitch ~125 Hz Female Pitch ~225 Hz

3 Data Sample Plotted sample in Matlab Looked for a periodic section with large peaks Needs to be periodic for autocorrelation to be effective Used export2asm.m to export to a.asm file

4 Algorithm Export periodic sample of male/female voice into data file (.asm) Perform Autocorrelation on sample Locate peaks and calculate the period Compare period Determine gender of speaker

5 Autocorrelation Help identify the fundamental frequency of a signal

6 Pitch – Peak Location Locate peaks above a certain threshold Make sure the peak is rising Ensure we only count the peak once Keep track of how many peaks are detected Disregard the first peak Sum the position of the peaks (period) Calculate the average period

7 Male or Female Pitch = Fs / ave. period Assign pitch range > 150 Hz = Female < 150 Hz = Male Compare average periods Division is difficult of DSP EX: Fs = 22050 Ave. period < 147 = female Ave. period > 147 = male

8 Problem Solving Minor Logic/Syntax Errors Not storing a calculated value to the correct spot Assigning values at the wrong time Used temp variable to hold values – eliminate overriding existing values Extracting Periodic Sample Leveling 16 Bit Storage Compare Operand (TC) NOP

9 Extracting Periodic Sample Make sure there are 5 periodic peaks Dividing occurs by shifting 5 peaks = 4 periods We will average the sum of the periods by right shifting 2 (>> 2) Too many variables Modify export2asm.m to have only one variable

10 Data Sample FemaleMale

11 Leveling Need to define a threshold in which only peaks above this threshold would be counted By leveling the autocorrelation we are able to find this threshold R(1,i) = R(1,i) + i*25 Data points near the beginning hardly get shifted, while points near the end see a more dramatic shift

12 Autocorrelation w/o Leveling Female Male

13 Autocorrelation w/ Leveling Female Male

14 16 Bit Storage Multiplication’s involved in the autocorrelation Registers can’t hold the values of these products By scaling these products by 1024 ( >> 10) we are able to reproduce a similar autocorrelation with smaller numbers

15 Compare Operand (TC) Compare (TC) operand wasn’t working properly Accumulator deals with signed number Can distinguish between positive/negative numbers TC is unsigned doesn’t recognize a negative number as negative, but a large positive number Shifted all the data points so that there were no negative numbers Added the lowest number to all the data points Therefore the minimum value was at 0

16 NOP

17 Program doesn’t perform correctly when running on the DSP Adding breakpoints and stepping through generated different, more accurate results Similar to a problem we had in the sorting exercise Adding NOP’s after lines of codes fixed the problem No operation Allows DSP to run each line separately instead of deciding on its own whether to run two lines of code simultaneously

18 Demo Case 1 Male Pitch Pitch Detected = ~113 Hz Case 2 Female Pitch Pitch Detected = ~202 Hz Our program successfully modeled our MATLAB design

19 Conclusion Started off hoping to implement a program that would detect whether a voice was male/female and then change there voice to the opposite sex Couldn’t find any code we could use Having to write code from scratch we simplified the program to just determine pitch Overall project was a success Good Matlab and DSP results Gained knowledge in coding & debugging in assembly


Download ppt "PITCH DETECTION Shaan Patel HoangMinh Nguyen Richard King."

Similar presentations


Ads by Google