Questions tagged [sine-wave]

43 questions
12
votes
8 answers

drawing sine wave in canvas

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
BRDroid
  • 3,920
  • 8
  • 65
  • 143
9
votes
2 answers

Plot FFT as a set of sine waves in python?

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…
MetaStack
  • 3,266
  • 4
  • 30
  • 67
9
votes
2 answers

Animate sine wave, fixed start and end points

I have a sine wave in my canvas that is animated, swaying left and right. What I am trying to achieve is that the start and end points stay fixed. How to achieve that? Here is the Code Pen function start() { var canvas =…
felixo
  • 1,453
  • 6
  • 33
  • 60
5
votes
1 answer

How to associate days (1 to 365.25) to radians in perl?

I have number of days from 1 to 180 days, decreasing and increasing dates from the date $epoch='2020-05-11'. The full period = 365.25 days, an amplitude, a frequency and a phase will be added later in the end to create a sine wave. This is not the…
Peri
  • 81
  • 2
4
votes
1 answer

Drawing sine waves effeciently in android

I am making an app where I need to draw a sine wave between two given points. I have Google'd, and Google'd, and I haven't found anything that I have found suitable. Is there an efficient way in android to use some pre defined points to draw a…
DingleNutZ
  • 163
  • 1
  • 7
4
votes
1 answer

Why does this code produce a very noisy sine wave?

I'm trying to write a very simple sound synth in Java. I'm using the javax.sound.sampled package. The code below works, but the sine wave is very noisy and sounds like there's some kind of quiet warm noise played alongside the wave. try { …
abababab
  • 53
  • 5
4
votes
2 answers

How to create sinwave animation while Recording/Playing audio in Android app ?

It is easy to create in iOS application. Any one tell me the easy way to create the Sinwave animation while record and play the audio. I was tried soo many ways but I couldn't. Is there any third party frameworks for that? Can any one help me out…
Surezz
  • 561
  • 4
  • 12
3
votes
3 answers

Science of Chords

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…
Nimrod Sadeh
  • 183
  • 9
2
votes
1 answer

Problem when graphing sine waves in python

I've written the following program using python in order to graph multiple sine waves of different frequencies, as well as display the points of intersection between them; import numpy as np import matplotlib.pyplot as…
user13215247
2
votes
3 answers

Create Vertical Sine wave

I am developing a game which uses sine wave. I made use of the horizontal sin wave with the following example http://www.roseindia.net/java/example/java/swing/create_sine_wave.shtml How do create a similar kind of wave vertically?
Jana
  • 2,890
  • 5
  • 35
  • 45
2
votes
1 answer

How to convert sine wave form in to audio?

I have raw data: x-values y-values x being the time domain. Sample rate is 8000 Hz. I have plotted them in a sine wave, but can't seem to find any way to convert that into audio form. Can someone guide through this process?
Saif Ali
  • 429
  • 5
  • 23
2
votes
1 answer

How to fill the shape, made up of GL_LINE_LOOP

I'm trying to make do water simulation. But I'm restricted to use 2D, So i started with just making the boundary of the sea by using sine wave, through Gl_Line_loop. but I'm just unable to fill it. I have tried changing it to the Gl_polygon mode but…
shahtaj khalid
  • 476
  • 7
  • 24
2
votes
2 answers

issue when generating sine wave for more than 1 second

I have searched almost SO & few forums, but unable to figure out. I have not coded this from scratch. I got the code and I am trying to modify as per my requirement. So firstly credits to original coder. I am ref this…
vk41286
  • 113
  • 1
  • 1
  • 10
1
vote
2 answers

How can I generate a sine wave with consistent "vibrato"

I am trying to create a .wav file which contains a 440Hz sine wave tone, with 10Hz vibrato that varies the pitch between 430Hz and 450Hz. Something must be wrong with my approach, because when I listen to the generated .wav file, it sounds like the…
Erik Nyquist
  • 1,267
  • 2
  • 12
  • 26
1
vote
1 answer

How can I adjust the volume of the left or right channel of a sine wave individually?

I am trying to adjust the volume of each individual channel in a sine wave for stereo output. I am simply outputting this using WASAPI, with a 32 bit IEEE-float stereo format. I have a sine wave in 32 bit IEEE-Float format, and I try to set the left…
1
2 3