[DSP] Section 5 [Ref | AudioSignalProcessingForML ]
Digitalization Digital signal $g(t) \rightarrow x(n)$ $t=nT$ $\hat g(f) = \int g(t) \cdot e^{-i2\pi ft} dt$ $\hat x(f) = \sum_n x(n) \cdot e^{-i2\pi fn}$
!!Problem!! Continuous Freq. + Inf. Time Hack 1: Time consider $f$ to be non 0 in a finite time interval x(0), x(1), …, x(N-1) Hack 2: Freq. compute transform for finite # of freq. # feq (M) = # samples (N) Hacking $\hat x(f) = \sum_{n=0}^{N-1}x(n) \cdot e^{-i2\pi fn}$ $\hat x(k/N) = \sum_{n=0}^{N-1}x(n) \cdot e^{-i2\pi n {k \over N} }$ $F(k) = {k \over NT} = {k s_r \over N}$ Redundancy in DFT $k \ = \ N/2 \ \rightarrow \ F(N/2) \ = \ s_r / 2$ -> Nyquist Frequency
DFT is computationally expensive ($N^2$) FFT is more efficient ($Nlog_2N$) FFT exploits redundancies across sinusoids FFT works when N is a power of 2 1
2
3
4
5
import os
import numpy as np
import matplotlib.pyplot as plt
import librosa
import IPython.display as ipd
1
2
c:\ProgramData\Anaconda3\lib\site-packages\paramiko\transport.py:219: CryptographyDeprecationWarning: Blowfish has been deprecated
"class": algorithms.Blowfish,
1
2
3
4
5
6
BASE_DIR = r " ./audio/ "
voiolin_file = " violin_c.wav "
sax_file = " sax.wav "
piano_file = " piano_c.wav "
noise_file = " noise.wav "
1
ipd . Audio ( os . path . join ( BASE_DIR , voiolin_file ))
Your browser does not support the audio element. 1
ipd . Audio ( os . path . join ( BASE_DIR , sax_file ))
Your browser does not support the audio element. 1
ipd . Audio ( os . path . join ( BASE_DIR , piano_file ))
Your browser does not support the audio element. 1
ipd . Audio ( os . path . join ( BASE_DIR , noise_file ))