Created on 16 Feb 2015 @author: Ronny Andersson ([email protected]) @copyright: (c) 2015 Ronny Andersson @license: MIT ''' # standard library import logging # custom libraries from zignal.audio import Noise, Audio if __name__ == '__main__': logging.basicConfig( format='%(levelname)-7s: %(module)s.%(funcName)-15s %(message)s', level='DEBUG') fs = 96000 dur = 1.0 nw = Noise(fs=fs, duration=dur, gaindb=-6, colour='white') np = Noise(fs=fs, duration=dur, gaindb=-6, colour='pink') x = Audio(fs=fs) x.append(nw, np) print(nw) print(np) print(x) x.plot_fft()
@license: MIT ''' # standard library import logging # custom libraries from zignal.audio import Audio, Sinetone, Noise if __name__ == '__main__': logging.basicConfig( format='%(levelname)-7s: %(module)s.%(funcName)-15s %(message)s', level='DEBUG') fs = 10000 f0 = 10 dur = 0.1 x1 = Sinetone(f0=f0, fs=fs, duration=dur + 0.2, gaindb=0) xn = Noise(fs=fs, duration=dur, gaindb=-20) x = Audio(fs=fs) print(x) x.append(xn, x1) del x1, xn print(x) x.plot(ch='all')
# standard library from __future__ import print_function import logging # custom libraries from zignal.audio import Sinetone, Noise, Audio, SquareWave if __name__ == '__main__': logging.basicConfig(format='%(levelname)-7s: %(module)s.%(funcName)-15s %(message)s', level='DEBUG') fs = 48000 dur = 1.5 x1 = Sinetone(f0=997, fs=fs, duration=dur, gaindb=0) x2 = Noise(fs=fs, duration=dur, gaindb=-6) x3 = SquareWave(f0=3000, fs=fs, duration=dur, gaindb=-20) x4 = Audio(fs=fs) x4.append(x1, x2, x3) print(x1) print(x1.peak()) print(x1.rms()) print(x1.crest_factor()) print(x2) print(x2.peak()) print(x2.rms()) print(x2.crest_factor()) print(x3)
from __future__ import print_function import logging # custom libraries from zignal.audio import Sinetone, Noise, Audio, SquareWave if __name__ == '__main__': logging.basicConfig( format='%(levelname)-7s: %(module)s.%(funcName)-15s %(message)s', level='DEBUG') fs = 48000 dur = 1.5 x1 = Sinetone(f0=997, fs=fs, duration=dur, gaindb=0) x2 = Noise(fs=fs, duration=dur, gaindb=-6) x3 = SquareWave(f0=3000, fs=fs, duration=dur, gaindb=-20) x4 = Audio(fs=fs) x4.append(x1, x2, x3) print(x1) print(x1.peak()) print(x1.rms()) print(x1.crest_factor()) print(x2) print(x2.peak()) print(x2.rms()) print(x2.crest_factor()) print(x3)
Created on 15 Feb 2015 @author: Ronny Andersson ([email protected]) @copyright: (c) 2015 Ronny Andersson @license: MIT ''' # standard library import logging # custom libraries from zignal.audio import Sinetone, Noise if __name__ == '__main__': logging.basicConfig( format='%(levelname)-7s: %(module)s.%(funcName)-15s %(message)s', level='DEBUG') fs = 96000 f0 = 997 dur = 2.5 x = Sinetone(f0=f0, fs=fs, duration=dur, gaindb=0) n = Noise(channels=1, fs=fs, duration=dur, gaindb=-50) print(x) print(n) x.samples = x.samples + n.samples x.plot_fft(window='hamming')