Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from scipy.io import wavfile as wav
- from scipy.fftpack import rfft
- rate, data = wav.read('440Hz.wav')
- rawFTData = rfft(data)
- intFTData = [int(i) for i in rawFTData]
- from statistics import mode
- mode(intFTData)
- >> 0
- from collections import Counter
- count = Counter(intFTData)
- count.most_common()
- >> [(0, 1055), (-7, 588), (-15, 573), (43, 567), (-2, 563), (-6, 561), (-9, 557), (14, 555), (8, 554), (12, 551), (-11, 551), (26, 551), (11, 549), (19, 549), (-48, 549), (-26, 549), (-5, 545), (13, 545), (34, 544), (45, 541), (56, 541), (-17, 540), (-12, 538), (33, 538), (-47, 538), (-13, 536), (-14, 536), (-34, 534), (39, 534), (-16, 534), (7, 534), (-19, 533), (-10, 533), (2, 532), (25, 532), (64, 532), (20, 530), (30, 530), (29, 530)...
Add Comment
Please, Sign In to add comment