Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (33 sloc) 734 Bytes
function [w,wl,wr]=fhanning(n)
% [w,wl,wr]=fhanning(n)
%
% Calculates Hanning windows of a certain length
%
% INPUT:
%
% n The required length of the window
%
% OUTPUT:
%
% w The Hanning window for bandpass
% wl The left half of the window for lowpass
% wr The right half of the window for lowpass
%
% Last modified by fjsimons-at-alum.mit.edu, 08/05/2014
if ~rem(n,2)
% Even length window
half = n/2;
wl = channing(half,n);
w = [wl; wl(end:-1:1)];
else
% Odd length window
half = (n+1)/2;
wl = channing(half,n);
w = [wl; wl(end-1:-1:1)];
end
if nargout>=3
wr=flipud(wl);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function w = channing(m,n)
w = .5*(1 - cos(2*pi*(1:m)'/(n+1)));
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.