Showing posts with label window function. Show all posts
Showing posts with label window function. Show all posts

Tuesday, July 6, 2010

LabVIEW: Windowing Program

Hello everyone,
Sorry for the delay. Last week and yesterday I spent most of my time fiddling around with LabVIEW. Currently I have a program that takes two inputs waveforms (reference and sample THz signals), plots them in time, allows for the selection of 1 region of interest for each, then apodizes those sections, and through the use of an FFT, finally plots their phases and magnitudes versus frequency.The front panel starts off with separate reference and sample time plots. Cursors 0 and 1 allow the user to select the ROIs. The effect of different apodization functions (aka smoothing and window functions) on the ref and sample sections can be observed in the graphs below. To the left of these graphs there is a ‘Windows’ drop down menu with an accompanying number slide bar. And below all of this are the phase and magnitude versus frequency plots of the apodized waveforms. There is a stop button on the front panel because, as will be shown in the block diagram, the functions being performed are in a while loop. This allows for the run to be continuous, thus allowing for uninterrupted observation of the changes the user makes in the front panel.
Much of the block diagram is reminiscent of my first program, which was explained in full detail in a previous blog post. The new VIs include:
  • Extract Portion of Signal - This extracts the ROI defined by the cursors, replots it on the original graph where it is highlighted, and feeds the waveform data into the windows 2 subVI.
  • Windows 2 – This subVI I customized (with Bianca’s guidance) to allow the user to select different apodization windows and input parameter values when needed. This was done by creating a case structure containing cases for every window function. The user can select which window function he or she would like to use through the drop down menu on the front panel. The menu item selected has a numerical value attached to it that informs the case structure which case to perform. The waveform is then reconstructed with the new apodized amplitude values. *I will explain what such functions do, the motivation for why they are applied, and discuss which ones are/aren’t advantageous for the particular THz data I’m working with. Expect this in the next blog entry.*
  • Align and Resample - This VI looks at both the apodized reference and sampled waveforms and makes the following changes: resamples both using the lower dt of the two, and makes the waveforms equal length by appending a zero amplitude tail at the end of the shorter waveform. *This is important when it comes to sampling in the frequency domain and parameter extraction, which will also be explained soon.*
  • FFT – The temporal waveforms undergo a Fast Fourier Transform with the use of this VI. The THz radiation signals can be plotted as phase vs frequency and magnitude vs frequency graphs.
  • While Loop- All of these VIs are contained in a while loop. The user can now note immediate changes to the graphs as he or she changes ROIs, window functions, or window parameters.