Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
ADC Testing
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
ADC Testing
Commits
fd3e10b4
Commit
fd3e10b4
authored
Jan 30, 2011
by
Juan David Gonzalez Cobas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add generator of sampled sinewaves
parent
81155117
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
sampler.py
sampler.py
+19
-0
No files found.
sampler.py
0 → 100644
View file @
fd3e10b4
#! /bin/sh
# coding: utf-8
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
from
numpy
import
linspace
,
pi
,
sin
def
sampled_sine
(
A
,
w
,
phase
,
C
,
fs
,
t0
=
0.0
,
t1
=
1.0
):
samples
=
(
t1
-
t0
)
*
fs
time
=
linspace
(
t0
,
t1
,
samples
,
endpoint
=
False
)
wave
=
A
*
sin
(
w
*
time
+
phase
)
+
C
return
wave
if
__name__
==
'__main__'
:
from
matplotlib
import
pyplot
as
pl
s
=
sampled_sine
(
1
,
2
*
pi
,
0
,
0
,
8000
)
pl
.
plot
(
s
)
print
'samples =
%
d'
%
s
.
size
pl
.
show
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment