Python Forum
How to generate single Sinewave?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to generate single Sinewave?
#1
Hi,

I am learning the Python language. Which block is best for studying the Python language. This is my first exercise that how to generate sinewave. ? Any idea
Reply
#2
Generate a sinewave on what? on graphics chart, on audio device?
Reply
#3
You can use numpy:

import numpy as np
x = np.linspace(0, 2 * np.pi, 1024)
sinewave = np.sin(x)
I guess you want to plot them also:

import matplotlib.pyplot as plt
plt.plot(sinewave)
plt.show()
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020