Piano note recognition

Attribution Non-Commercial (BY-NC)

75 views

Piano note recognition

Attribution Non-Commercial (BY-NC)

- 2-59
- Pulse Code Modulation
- Charles E. Ebeling-Introduction to Reliability and Maintainability Engineering-Waveland Pr Inc (2005)
- The Oscilloscope
- ssrc
- 2016 Tutorial 21 Probability I (Level 0)
- Romanian Society of Applied and Industrial Mathematics
- Ads 7822
- TQC TUGAS
- Rotkowitz-when is a Linear Controller Optimal
- Praat
- Theoretical Comparison of Direct-Sampling Versus Heterodyne RF Receivers - IEEE Journals & Magazine
- Sound Card - Sound Blaster X-fi Sb0679 Rev1.0
- AS_43083_AG_600847_GB_WW_1084-2 Copy
- 631S09_lec1intro
- DE63 dec 2012
- 2011 SB MSc Thesis
- Trio Hazloc Cutsheet-0622 (1)
- Case Study of NS0808ADC
- Atmel 42777 Digital Sound Recorder Using Dac With Attiny817 Applicationnote Avr42777

You are on page 1of 14

By Morgan Robinson

I was in band for 8 years of my life

Matlab is a strong program for signal processing

BASIC CONCEPT

Import wav file of simple piano song ex. Mary had a little lamb

Determine the frequency of each note Transform the frequency into one octave Compare that to the known frequency of notes

SOURCE CODE

F = frequency(onsets,y,Fs); F1 = correction1(F); notes = Note1(F1); end onsets = findonsets(y); function [ notes ] = project1( file ) [y, Fs] = wavread(file);

Wavread

[y,fs] = waveread(file);

y = sample data fs = the sample rate in Hertz used to encode the data in the file, basically the number of samples per second (fs = frames per second)

Tried a lot of different methods function [ onsets ] = findonsets ( y ) L = length(y); S = 1; %status trying to find begining (on/true)

k = 1; %position in array

topthresh = .2*(max(y)); bottomthresh = .05*(max(y)); for P = 51:L-50 if S == 1 if max(abs(y(P-50:P+50))) > topthresh S = 0; onsets(k) = P; k=k+1; end else

end

S = 1; onsets(k) = P; k=k+1; end end

DETERMINING FREQUENCY

function [ F ] = frequency( onsets,y,Fs) i = length(onsets)/2; a=1; b=2; for j=1:i z=y(onsets(a):onsets(b));

L = length(z);

fftz = fft(z)/L; power = 2*abs( fftz(1:round(L/2))); freq = ((1:L/2)*Fs/L); [C,I]= max(power); F(j) = freq(I); a=a+2; b=b+2; end

FFT picks out individual frequencies in some signal and shows you how much of your total signal (in the time domain) is in a particular place in your frequency domain.

end

function [ F1 ] = correction1( F )

i=length(F);

for j=1:i [F1(j)] = correction(F(j)); end

end

function [ F1 ] = correction( F ) if F >= 254.284 && F <= 508.5675 F1=F; elseif F < 254.284

[F1] = correction(2*F);

elseif F > 508.5675 [F1] = correction(F/2); end end

function [ Note1 ] = Note1( F ) i=length(F); for j=1:i Note1{j} = Note(F(j));

Cell array

end

end

function [ Note ] = Note( F ) if F >= 254.28 && F < 269.40 Note = 'C'; elseif F >= 269.40 && F < 285.42 Note = 'C#'; elseif F >= 285.42 && F < 302.40 Note = 'D'; elseif F >= 302.40 && F < 320.38 Note = 'D#'; elseif F >= 320.38 && F < 339.43 Note = 'E'; elseif F >= 339.43 && F < 359.61 Note = 'F'; elseif F >= 359.61 && F < 380.99 Note = 'F#'; elseif F >= 380.99 && F < 403.65 Note = 'G'; elseif F >= 403.65 && F < 427.65 Note = 'G#'; elseif F >= 427.65 && F < 453.08 Note = 'A'; elseif F >= 453.08 && F < 480.02 Note = 'A#'; elseif F >= 480.02 && F < 508.57 Note = 'B'; else error('frequency outside of acceptable range') end end

Demo

OTHER USES

Print sheet music

Length of notes

Octave Voice verification

Voice Identification

REFERENCES

www.phy.mtu.edu/~suits/notefreqs.html www.mathworks.com/matlabcentral/ www.reddit.com/search?q=subreddit%3A+matlab

- 2-59Uploaded byJoanna Linette
- Pulse Code ModulationUploaded byEr Amarsinh Ranaware
- Charles E. Ebeling-Introduction to Reliability and Maintainability Engineering-Waveland Pr Inc (2005)Uploaded byyesika
- The OscilloscopeUploaded byVittorio J. Williams
- ssrcUploaded byDobranis Razvan - Ionut
- Romanian Society of Applied and Industrial MathematicsUploaded byallinac
- Ads 7822Uploaded byVishy
- PraatUploaded byAndrés García
- 2016 Tutorial 21 Probability I (Level 0)Uploaded byJiabaoZheng
- Rotkowitz-when is a Linear Controller OptimalUploaded byNicolae Marinica
- Theoretical Comparison of Direct-Sampling Versus Heterodyne RF Receivers - IEEE Journals & MagazineUploaded byEnricoLia
- AS_43083_AG_600847_GB_WW_1084-2 CopyUploaded byPraveen Sreedharan
- TQC TUGASUploaded byArga Saputra
- Sound Card - Sound Blaster X-fi Sb0679 Rev1.0Uploaded byLudwig Schmidt
- 631S09_lec1introUploaded byAtul Singh Bhadauria
- DE63 dec 2012Uploaded byRakesh Rajbhar
- 2011 SB MSc ThesisUploaded byFinigan Joyce
- Trio Hazloc Cutsheet-0622 (1)Uploaded byAhmed El-Shafei
- Case Study of NS0808ADCUploaded bySeetharaman Narayanan
- Atmel 42777 Digital Sound Recorder Using Dac With Attiny817 Applicationnote Avr42777Uploaded byAndy Aragon
- Selected Answers Ch 9-13Uploaded byVibhuKumar
- Frequency Content of SignalUploaded byMie Jie
- Unit-3Uploaded byHrishikesh
- 66395636 Multirate Dsp PresentationUploaded byS.Dharanipathy
- CTsaturation.pdfUploaded bylrpatra
- advance power codeUploaded byLeing Chuen Fong
- Assignment q1&q2Uploaded byAbdullah Helmi
- BIOINSTRUMENTATION DESIGN1Uploaded byjose_mario1128
- PSOExampleUploaded bysurjyo_8
- ADCUploaded byĐạtNguyễn

- Heat Pipe Demonstrator Manual.docUploaded byShoaib Pathan
- Cape Unit 1 Chemistry SyllabusUploaded byRan J. Foster
- Institutes Offering Short Term Courses in Electronics After BUploaded bybrpnaidu2157
- InstallUploaded byDarren Camilleri
- Norsho PDF Norshore PublicUploaded byjrladdu
- A Critical Review of Dental Implant Materials with an Emphasis on Titanium versus ZirconiaUploaded byTheodoros Katsipanos
- 8692 e 0514591Uploaded bySing-Yew LAM
- Pipe2000 Combined ManualUploaded byabhijitdalvi
- 2G +5GUploaded byRahul Moottolikandy
- Bit ManipulationUploaded bymanojdjoshi
- SSP 265 Vehicle Electrics in Polo MY 02 (2)Uploaded byภูเก็ต เป็นเกาะ
- Anbari Research Springfield Interchange Case StudyUploaded byDerrick Antonio Gardner
- Unit Conversion Data for NitrogenUploaded byTrebor Zurc
- CCIE Security Written Exam Topics v4.0 RegisteredUploaded byVenkatadri Cheemakurthi
- P139_EN_M_B22_VOL1Uploaded byRazvan Mares
- Skin Put DocUploaded byS.v. Ramesh
- Thermodynamics Chapter 2Uploaded byGarrett Weidman
- Whitepaper- The Case for Automation in Commercial LendingUploaded byMudit Kothari
- Lecture 3 & 4- Composites (Slides)Uploaded byJustDen09
- ASTM-E125Uploaded byruben carcamo
- Prediction of Success or Failure of Software Projects based on Reusability Metrics using Support Vector MachineUploaded byEditor IJRITCC
- Handover(GBSS19.1_01)Uploaded byWael Alkodami
- is.iso.20474.3.2008Uploaded byrewmarineq
- SAP BASIS SPOOL SPOOL.docxUploaded byramana1109
- ProcurementUploaded byVashish Ramrecha
- Emerging Technologies for Wastewater TreatmentUploaded byNguyen Phuc Pham
- MySQL Workbench - OracleUploaded bywagnerp
- 6568074 Wimax Presentation for HuaweiUploaded bysiddharthjmt
- JAVA Project ListUploaded byswathi manthena
- res_show (2).pdfUploaded byPrasobh AS