Home > wafo > onedim > private > parzen.m

# parzen

## PURPOSE

returns the N-point Parzen window in a column vector.

## SYNOPSIS

[w, be] = parzen(n,fs)

## DESCRIPTION

```  PARZEN returns the N-point Parzen window in a column vector.

CALL:   [win Bw] = parzen(n,fs);

win = parzen window
Bw = bandwidth of the window
n = number of points
fs = sampling frequency (default 1)

## CROSS-REFERENCE INFORMATION

This function calls:
This function is called by:
 dat2spec Estimate one-sided spectral density from data. dat2spec2 Estimate one-sided spectral density, version 2. reconstruct reconstruct the spurious/missing points of timeseries

## SOURCE CODE

```001 function [w, be] = parzen(n,fs)
002 % PARZEN returns the N-point Parzen window in a column vector.
003 %
004 %  CALL:   [win Bw] = parzen(n,fs);
005 %
006 %    win = parzen window
007 %     Bw = bandwidth of the window
008 %      n = number of points
009 %     fs = sampling frequency (default 1)
010 %
012
013 % tested on: Matlab 5.3
014 % History:
015 %   by Per Andreas Brodtkorb 14.12.1997
016 if nargin<2|isempty(fs),
017   fs=1;
018 end
019
020 if nargout > 1
021  be=1.33/(n+1)*fs; %bandwidth in Hz if fs in Hz
022 end
023 if 1, %old oversion
024   tau=2*abs((1:n)/(n+1)-0.5) ;
025   tau1=tau(find(tau<=0.5));
026   tau2=tau((find(tau>0.5)<(n/2) ));
027   tau3=fliplr(tau2);
028   w=[2*(1-tau2).^3 1-6*tau1.^2+6*tau1.^3  2*(1-tau3).^3]';
029
030 end
031
032
033```

Mathematical Statistics
Centre for Mathematical Sciences
Lund University with Lund Institute of Technology

Comments or corrections to the WAFO group

Generated on Thu 06-Oct-2005 02:21:16 for WAFO by m2html © 2003