MAKE A MEME View Large Image Sawtooth harmonics.png sawtooth wave in both time-domain and truncated frequency-domain representation 2014-07-19 22 40 37 own Ldo Generated with the following code <pre> import numpy as np import matplotlib pyplot as plt frames_per_cycle ...
View Original:Sawtooth harmonics.png (812x612)
Download: Original    Medium    Small Thumb
Courtesy of:commons.wikimedia.org More Like This
Keywords: Sawtooth harmonics.png sawtooth wave in both time-domain and truncated frequency-domain representation 2014-07-19 22 40 37 own Ldo Generated with the following code <pre> import numpy as np import matplotlib pyplot as plt frames_per_cycle 256 freq 3 nr_frames frames_per_cycle freq phase 0 audio np fromfunction lambda y y / frames_per_cycle + phase 1 - 0 5 nr_frames maxfreq 16 freq_plotstyle o ft np fft rfft audio frames_per_cycle / frames_per_cycle / 2 if maxfreq None ft ft maxfreq end if abs_mag True fig ax plt subplots nrows 2 + int not abs_mag ax0 plot np linspace 0 freq nr_frames audio - ax0 set_title Time Domain if abs_mag ax1 plot np linspace 0 len ft len ft np abs ft freq_plotstyle ax1 set_title Frequency Domain else ax1 plot np linspace 0 len ft len ft np real ft freq_plotstyle ax1 set_title Frequency Domain Real ax2 plot np linspace 0 len ft len ft np imag ft freq_plotstyle ax2 set_title Frequency Domain Imag end if plt subplots_adjust hspace 0 5 plt show </pre> cc-zero Uploaded with UploadWizard Created with Matplotlib Fourier analysis
Terms of Use   Search of the Day