sine-wave

Plot FFT as a set of sine waves in python?

笑着哭i 提交于 2020-03-02 19:13:25
问题 I saw someone do this in a presentation but I'm having a hard time reproducing what he was able to do. Here's a slide from his presentation: Pretty cool. He decomposed a dataset using FFT, then plotted the appropriate sine waves that the FFT specified. So in an effort to recreate what he did, I created a series of points that correspond to the combination of 2 sine waves: import matplotlib.pyplot as plt import numpy as np %matplotlib inline x = np.arange(0, 10, 0.01) x2 = np.arange(0, 20, 0

Science of Chords

十年热恋 提交于 2019-12-11 03:26:33
问题 This question was migrated from Music: Practice & Theory Stack Exchange because it can be answered on Stack Overflow. Migrated 5 years ago . I've been doing research on trying to understand the way sounds and sine waves work, particularly with chords. So far, my understanding is as follows: b(t) = sin(Api(t)) is the base note of the chord at frequency A. T(t) = sin(5/4piA(t)) is the major third of the base b(t). D(t) = sin(3/2piA(t)) is the dominant (fifth) of the base b(t). A(t) = sin(2Api(t

Find start point (time) of each cycle in a sine wave

寵の児 提交于 2019-12-02 13:26:46
问题 I am tying to achieve sine wave gradually changing from 8Hz to 2Hz over 5 seconds: This waveform was produced in Cool Edit . I gave it a start frequency of 8Hz , an end frequency of 2Hz and a duration of 5 seconds. The sine wave gradually changes from one frequency to the other over the given time. My question is, how can I accurately find the start time of each cycle (highlighted with a red dot), using a FOR loop? Pseudo code: time = 5 //Duration freq1 = 8 //Start frequency freq2 = 2 //End

Find start point (time) of each cycle in a sine wave

◇◆丶佛笑我妖孽 提交于 2019-12-02 04:11:48
I am tying to achieve sine wave gradually changing from 8Hz to 2Hz over 5 seconds: This waveform was produced in Cool Edit . I gave it a start frequency of 8Hz , an end frequency of 2Hz and a duration of 5 seconds. The sine wave gradually changes from one frequency to the other over the given time. My question is, how can I accurately find the start time of each cycle (highlighted with a red dot), using a FOR loop? Pseudo code: time = 5 //Duration freq1 = 8 //Start frequency freq2 = 2 //End frequency cycles = ( (freq1 + freq2) / 2 ) * time //Total number of cycles for(i = 0; i < cycles; i++) {

drawing sine wave in canvas

天涯浪子 提交于 2019-11-30 14:13:55
问题 I am trying to draw a simple sine wave in a canvas but i am not getting it right. this is my desired output as in the picture. What I have got so far is http://jsfiddle.net/RaoBurugula/gmhg61s6/4/ HTML <canvas id="myCanvas" width="360" height="360" style="border:1px solid #d3d3d3;"> JS var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); var i; for(i=0; i<360; i+= 20){ ctx.moveTo(i+5,180); ctx.lineTo(i,180); } ctx.stroke(); var counter = 0, x=0,y=180; //100 iterations