aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/fft.lua
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2023-12-19 02:38:48 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2023-12-19 19:38:32 +0300
commite983ee7b0760210fdc220364d6c78c92ed8d8479 (patch)
tree66c36f487ed701a31649193e1c58d454591bf6e0 /examples/fft.lua
parent0320d0b02530fb33eb15508bc3620221f814b11f (diff)
downloadapplause2-e983ee7b0760210fdc220364d6c78c92ed8d8479.tar.gz
added a free sample to be used with the FFT examples
* license of the project is GPLv3 now
Diffstat (limited to 'examples/fft.lua')
-rw-r--r--examples/fft.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/fft.lua b/examples/fft.lua
index 417f3c6..5930f46 100644
--- a/examples/fft.lua
+++ b/examples/fft.lua
@@ -15,8 +15,8 @@ tostream(phase(FFT(Stream.SinOsc(samplerate*20/1024, 0.7):sub(1, 1024)))):gnuplo
-- Naive pitch shifting
-- This is not easy to get right. See https://www.reddit.com/r/DSP/comments/k6t24c/pitch_shifting_algorithm_in_frequency_domain/
-robin = SndfileStream("tracks/robin-mono.wav"):sub(sec(10.284), sec(17.466)):eval()
-robin:FFT(1024):map(function(spectrum)
+haiku = SndfileStream("examples/haiku.flac")
+haiku:FFT(1024):map(function(spectrum)
assert(#spectrum == 513)
-- NOTE: We cannot use Stream:resample() as it won't work with complex samples.
for i = 1, 512/2 do spectrum[i] = spectrum[i*2] end