-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathunif_rect_wind.m
More file actions
executable file
·26 lines (20 loc) · 894 Bytes
/
unif_rect_wind.m
File metadata and controls
executable file
·26 lines (20 loc) · 894 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
25
26
function [wts,idx] = unif_rect_wind(wlen,whop,flen)
% -----------------------------------------------------
% Usage: [wts,idx] = unif_rect_wind(wlen,whop,flen)
% function to obtain uniform rect windows ...
% of a given window size wlen and window hop whop ...
% Returns the sub-band window with square shape in wts
% The index of the sub-band DCTs is present in idx
% --------------------------------------------------
w = ones(1,flen); % Sub-band window with square shape
[wind,addSamp] = frame_new(w,wlen,wlen-whop); % Ibtain the sub-band windows
N_fr = size(wind,2) ;
wts = cell(1,N_fr);
idx = zeros(N_fr,2); % Array containing the indices for each sub-band with w.r.t full band DCT.
idx(1,:) = [1 wlen];
for I = 1 : N_fr % Finding the starting and end-points of each sub-band.
wts{I} = wind(:,I);
if I > 1
idx(I,:) = idx(I-1,:)+whop;
end
end