-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindowGraphs.m
More file actions
24 lines (21 loc) · 767 Bytes
/
windowGraphs.m
File metadata and controls
24 lines (21 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
clearvars;
%initialize variables
N = 29; %window length
len = 51; %sequence length
fs = 44100;
padding = 1024;
yAxisRange = [-80 0];
infoString = ['\fontsize{9}Window Length: ', num2str(N), ' , Sequence Length: ', num2str(len), ', F_s: ', num2str(fs)];
timeIndex = (0:len-1) - floor(len/2);
rectWindow = zeroCenteredRect(len, N);
hannWindow = zeroCenteredHann(len, N);
%plot & export Rectangular Window
figure
sgtitle(['Rectangular Window: ', infoString]);
plotTimeAndFreq(rectWindow, timeIndex, fs, padding, yAxisRange=yAxisRange);
saveas(gca, './exports/rectWindow.png');
%plot & export Hann Window
figure
sgtitle(['Hann Window: ', infoString]);
plotTimeAndFreq(hannWindow, timeIndex, fs, padding, yAxisRange=yAxisRange);
saveas(gca, './exports/hannWindow.png');