Using spectral windows


Spectral windows are typically used in spectral analysis algorithms. In all LTPDA spectral analysis functions, spectral windows are specified as parameters in an input parameter list. The following code fragment shows the use of ltpda_pwelch to estimate an Amplitude Spectral Density of the time-series captured in the input AO, a_in. The help for ltpda_pwelch reveals that the required parameter for setting the window function is 'Win'.

	w = specwin('Kaiser', 100, 150);
	pl = plist(param('Win', w))
	axx = ltpda_pwelch(a_in, pl);
  

In this case, the size of the spectral window (number of samples) may not match the length of the segments in the spectral estimation. The ltpda_pwelch algorithm then recomputes the window using the input design but for the correct length of window function.

Spectral windows can also be used more directly by first converting them to Analysis Objects. The following code fragment converts a specwin object to an Analysis Object. This AO is then multiplied against another time-series AO to window the data.

	a = ao('data1.txt')
	w  = specwin('Kaiser', len(a), 150);
	wa = ao(w);
	a_win = a.*wa;
  

Note here that the len method of the AO class is used to produce a window function that is of the same length as the time-series contained in a.




©LTP Team