Created
March 29, 2016 19:42
-
-
Save Enchufa2/394b72acb0eac979a642b03b3af04265 to your computer and use it in GitHub Desktop.
Simulation of the chirp echo created in the staircases of Mesoamerican pyramids
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clap = audioread('clap.wav'); | |
fs = 96e3; % sampling frequency | |
N = 40; % steps | |
ssize = 0.15; % step size | |
delay = ssize * 2 / 340; | |
samples = round(delay * fs); | |
stairs = zeros(samples * N + length(clap) + N, N); | |
for i = 1:N | |
samples = samples + 1; | |
indexes = (i-1)*samples+1 : length(clap)+(i-1)*samples; | |
stairs(indexes, i) = clap; | |
end | |
stairs = sum(stairs, 2); | |
audioplayer(clap, fs).play(); | |
audioplayer(stairs, fs).play(); | |
figure; | |
ax1(1) = subplot(2, 2, 1); | |
plot((1:length(clap))/fs, clap); | |
ax2(1) = subplot(2, 2, 2); | |
periodogram(clap); | |
ax1(2) = subplot(2, 2, 3); | |
plot((1:length(stairs))/fs, stairs); | |
ax2(2) = subplot(2, 2, 4); | |
periodogram(stairs); | |
set(ax2, 'xscale', 'log'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't know if I keep that file, but there are few things as easy and cheap as recording a clap. ;-)