source: misc/tools/demos/matplotdemo3.py @ 7276

Last change on this file since 7276 was 7276, checked in by ole, 15 years ago

Merged numpy branch back into the trunk.

In ~/sandpit/anuga/anuga_core/source
svn merge -r 6246:HEAD ../../branches/numpy .

In ~/sandpit/anuga/anuga_validation
svn merge -r 6417:HEAD ../branches/numpy_anuga_validation .

In ~/sandpit/anuga/misc
svn merge -r 6809:HEAD ../branches/numpy_misc .

For all merges, I used numpy version where conflicts existed

The suites test_all.py (in source/anuga) and validate_all.py passed using Python2.5 with numpy on my Ubuntu Linux box.

File size: 417 bytes
Line 
1import numpy as num
2from pylab import randn, conv, plot, psd, subplot, show
3
4
5# Create signal
6dt = 0.01
7t = num.arange(0, 10, dt)    # Time vector
8signal = 0.1*num.sin(2*num.pi*t)
9
10# Create noise
11noise = conv(randn(len(t)), num.exp(-t/0.05))*dt
12noise = noise[:len(t)]
13
14# Create noisy signal and plot
15noisy_signal = signal + noise
16
17subplot(211)
18plot(t, noisy_signal)
19subplot(212)
20psd(noisy_signal, 512, 1/dt)
21
22show()
23
Note: See TracBrowser for help on using the repository browser.