📄 window.3t
字号:
.\" Copyright (c) 1987\-1990 Entropic Speech, Inc..\" Copyright (c) 1990\-1997 Entropic Research Laboratory, Inc..\" All rights reserved..\" @(#)window.3t 1.10 01 Oct 1998 ESI/ERL.ds ]W (c) 1997 Entropic Research Laboratory, Inc..TH WINDOW 3\-ESPSsp 01 Oct 1998.SH NAMEwindow \- window a data array..SH SYNOPSIS.nf.ft B#include <esps/windows.h>#include <esps/window.h>.spint window(nsamp, x, y, type, p) long nsamp; float *x, *y; int type; double *p;.spint windowd(nsamp, x, y, type, p) long nsamp; double *x, *y; int type; double *p;.spint windowcf(nsamp, x, y, type, p) long nsamp; float_cplx *x, *y; int type; float_cplx *p;.spint windowcd(nsamp, x, y, type, p) long nsamp; double_cplx *x, *y; int type; double_cplx *p;.spchar *window_types[];.spintwin_type_from_name(name); char *name;.ft.fi.SH DESCRIPTIONThe four functions.I window,.I windowd,.I windowcf,and.I windowcdeach take an array of .I nsampinputs in .I x,window it with the data window indicated by.I type,and return the .I nsampoutputs in the.I yarray.They differ only in the data types on which they operate..PPThe argument.I pcan be used in two ways.Either it is a pointer toparameters needed for the specification of the window,or it can also be used to specify an arbitraryuser-defined window type.For exampleif a Kaiser window was specified,.I pwould be a one element vector that contained the shape parameter.In supported window types,the size of the .I parray is a function of the window type.In the other case,.I pis a vector containing the weightingfunction values; it is assumed that.I pcontains \fInsamp\fP values.Note that .I xand .I ymay be the same array..PPCurrently implemented window types are the following:.sp.TScenter, tab($), allbox;c sc|cc|n.WINDOW FUNCTIONSType$P Dimensionrectangular (WT_RECT)$0Hamming (WT_HAMMING)$0triangular (WT_TRIANG)$0Hanning (WT_HANNING)$0Kaiser (WT_KAISER)$1cos**4 (WT_COS4)$0arbitrary (WT_ARB)$nsamp.TE.sp .35.PPWhen \fIp\fR has dimension zero,the appropriately cast NULL should be passed to the function (see the example below)..PPNote that window(3\-ESPS) defines a string array\fIwindow_types\fR that contains the names of all legalwindow functions. The include file \fIwindow.h\fR containsnumerical equivalents for the all these names, andit also declares the \fIwindow_types\fR array for the user..PPThe function.I win_type_from_nametakes a window-type name without the "WT_" prefix (e.g. "HAMMING") andreturns the corresponding numeric code (e.g. WT_HAMMING).The function is case-insensitive, so it would also return WT_HAMMINfor the input "Hamming" or "hamming".It returns the value of the constant WT_NONE if the input is notone of the recognized window type names.See the example below..SH EXAMPLE.nf#include <esps/window.h>float x[100], y[100];long nsamp = 100;int data_window;char *window_func = "HAMMING"; /* Use Hamming window*/FILE *fpin; /* input file stream pointer */struct header *ih; /* input sampled data file header*//* get window type from string */ if ((data_window = win_type_from_name(window_func)) == WT_NONE) ERROR_EXIT("Invalid window function specified.");/* get sampled data */ get_sd_recf(x, nsamp, ih, fpin);/* window data */ if ((window(nsamp, x, y, data_window, (double *) NULL)) != 0) ERROR_EXIT("Error in window function");.fi.SH DIAGNOSTICSThe windowing functions return 0 if the windowing was done successfully..SH BUGSNone known..SH SEE ALSOauto(1\-ESPS), fft(1\-ESPS), refcof(1\-ESPS), .brcross_cor(1\-ESPS).SH AUTHORManual page and code by D. Burton. Complex functions added by B. Byrne.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -