0 Up votes0 Down votes

58 views5 pagesZero Padding

Oct 08, 2013

© Attribution Non-Commercial (BY-NC)

PDF, TXT or read online from Scribd

Zero Padding

Attribution Non-Commercial (BY-NC)

58 views

Zero Padding

Attribution Non-Commercial (BY-NC)

- EN 60068-2-27
- RVSP
- Agilent Spectrum analyzer basics an150
- Matlab - Theory - Fourier Analysis.pdf
- Fourier
- High-precision Harmonic Detection in Convolution
- Fft
- 2D-FFT
- 1.IJAEST Vol No 7 Issue No 1 FPGA Implementation of 2 D DCT for JPEG Image Compression 001 009
- Implementation of the Six Channel Redundancy to achieve fault tolerance in testing of satellites
- Simulation of Parallel Pipeline Radix 2^2 Architecture
- DSP Notes.pdf
- vm
- ANALIZADOR ESPECTRO 5952-0292.pdf
- DSP
- Harmonics Measurment
- 552_Notes_6c
- Communication Engineering
- Wcee12 2000 Auckland Varpasuo Paper1
- Fft Noise

You are on page 1of 5

1/21/12 3:12 AM

Overview This article discusses two common zero padding applications, including speeding up fast Fourier transform (FFT) calculation and the perceived benefit of improved resolution in the results. To complement the text, the article includes several LabVIEW 6.1 examples and tools to explain some of the ideas.

Table of Contents 1. 2. 3. 4. 5. 6. 7. Introduction Zero Padding Now Optional Padded Records Not Always a Good Fit Bin Shift Problems Does Signal = Signal + 0? Distinguishing Resolutions Zero Padding with LabVIEW

Introduction If you have ever worked with the nuts and bolts of computer-based spectral analysis, you have likely encountered zero padding. Often applied as a step in the signal processing associated with spectral analysis, zero padding involves appending one or more zeros to the end of a signal. It is a tool with a high perceived value related to improving the speed and resolution of the results. Unfortunately, it can lead to results that are easy to misinterpret. This article discusses two common zero padding applications, including speeding up fast Fourier transform (FFT) calculation and the perceived benefit of improved resolution in the results. To complement the text, the article includes live LabVIEW 6.1 examples and tools to explain some of the ideas. The section titled "Zero Padding with LabVIEW" discusses the mechanics of zero padding using LabVIEW and describes these examples. Follow the links in the section to download the software and run the examples as you read the text. Before getting to the details, consider where zero padding fits as one of the steps in a frequency-domain analysis algorithm. In a real application, the high-level steps described in this figure would likely require some additional processing to get a usable result. Examples of such extra processing might include vertical scaling associated with applying a window or buffering associated with performing a running FFT on a live signal. It is important to note that if you want to apply a window to your input signal, you should do so before appending any zeros.

http://zone.ni.com/devzone/cda/tut/p/id/4880

Page 1 of 5

Zero Padding Does Not Buy Spectral Resolution - Developer Zone - National Instruments

1/21/12 3:12 AM

Zero padding is often a step in the signal processing associated with spectral analysis. Zero Padding Now Optional Many engineers have experience with zero padding because of the nature of some FFT algorithms used to transform an array of data into spectral information. Some efficient FFT algorithms require an input array that is a power-of-two length. When applying these algorithms to non-power-of-two length datasets, you must zero pad or truncate your dataset to a power-of-two length. Because some modern FFT algorithms do not require a power-of-two length data set, the power-of-two length rule is no longer a requirement. However, power-of-two algorithms are typically more efficient in terms of the number of FFTs that you can calculate per second. This difference in efficiency can be the deciding factor for some applications -- the choice could depend on which of these options requires less processing: Data manipulation related to zero-padding + efficient FFT algorithm on a power-of-two length dataset Less efficient FFT algorithm on a nonpower-of-two length dataset The ever-increasing speed of modern processors simplifies the choice somewhat because the rate of calculating an FFT can increase without changing algorithms or block lengths. Nonetheless, few would argue that efficiency would ever be a nonissue because it enables other improvements in your measurement applications. If you can implement a more efficient FFT in your measurement code, you will have more processor time to dedicate to new features. Padded Records Not Always a Good Fit Differences in efficiency are not the only reason to change the input dataset length. Another issue involves how the content of the signals you are examining interacts with the discrete, or sampled, nature of the measurement and the computer-based operations that you apply to it. For the case where you know frequency interest for your input signal, you can choose an appropriate combination of sampling rate and record length to ensure that the FFT output will include that frequency. Consider that the output of the FFT is an array of values that represent what is actually a continuous (analog) spectrum. More accurately, an FFT is an efficient implementation of a discrete Fourier transform (DFT), an operation that results in samples of a discrete time Fourier transform (DTFT). The values in this array represent samples that are evenly distributed over a predefined frequency range. Each value represents a level at a specific frequency and this frequency is set by the following two constants: The sampling rate of the input signal (fs) The number of input samples (N) Given N samples of an input signal sampled at a rate of fs, the FFT output will be an array with N/2+1 samples. The elements of this array, which are also known as bins, will distribute evenly in frequency between 0 and fs / 2. Because the input array represents a duration of time equal to N / fs, the equal spacing between the output bins must be 1 / N / fs = fs / N. With this spacing, slot n of the FFT output array represents the frequency n (fs/N). The idea is to choose values for fs and N such that some value of n (fs / N) will equal your frequency of interest. Bin Shift Problems Zero padding shifts the inter-sample spacing in frequency of the array that represents your result. This shift can cause problems if it alters the array positions relative to the frequency of interest. The zero padding figure shows an example where the frequency of interest in the acquired signal is known to be 100 [Hz]. In the top window of the figure, applying an FFT to 100 samples of a signal acquired at a sampling rate of 10k [samples / s] results in an array of 50 values with the bin at array slot 10 conveniently representing the signal level at 100 [Hz]. To see the problem, consider what happens if you decide to zero pad the input signal with 28 to boost the length to a power of two. The fact that you no longer have a bin at exactly 100 [Hz] outweighs the benefit of any efficiency gain. As shown on the lower window the zero padding figure, the frequency-domain information related to the 100-[Hz] signal component is now spread between the 64 samples that result from the 128-point FFT. Information about the original 100 [Hz] signal component remains buried in the output samples. The computational overhead associated with any processing you apply to extract it will likely outweigh any benefits you might have garnered from having a power-of-two input length.

http://zone.ni.com/devzone/cda/tut/p/id/4880

Page 2 of 5

Zero Padding Does Not Buy Spectral Resolution - Developer Zone - National Instruments

1/21/12 3:12 AM

When you apply an FFT to a record length that covers an integer number of cycles at the frequency of interest, the bins of the resulting FFT will align with that frequency. Does Signal = Signal + 0? To better understand the effect on the frequency-domain sample spacing when you append zeros to the input, you can plug the changes into the above-mentioned formulas. When you append Nz zeros to an input signal with N samples, the FFT output becomes (N + Nz)/2 +1 samples. Because appending zeros does not change the input sampling rate, the frequency span of the FFT output will remain the same. The new output remains an evenly distributed set of samples spread over 0 to fs / 2. The sample spacing of the new output must decrease to fit more samples over the same frequency range. The slots of the output array now represent frequencies equal to n (fs / (N + Nz)), where n is again the index of the array. The decreased spacing is in the sampled output of the FFT and corresponds to a resolution increase in those samples. It is important to note that this increase does not improve frequency resolution of your analysis of the input signal. Distinguishing Resolutions In this situation, you can distinguish two separate frequency resolutions. The first is the resolution that quantifies the ability to distinguish two closely spaced frequencies from your original input signal. The second is the inter-sample spacing of the array of values that is output from an FFT-based algorithm. The resolution that distinguishes closely spaced frequencies is often the one that is of interest in your analysis because it is relevant to the spacing of frequencies from the original input signal. It is common for this to become confusing because these resolutions are equal if you have not applied any zero padding.

Sufficient frequency resolution allows you to distinguish closely spaced peaks with or without zero padding. The sufficient frequency resolution image provides an example of applying an FFT power spectrum to padded and nonpadded versions of an input signal that contains two main frequency components. The sampling rate and duration of the input signal are such that the frequencydistinguishing resolution is sufficient to distinguish the two components. The FFT Power Spectrum results from the padded and nonpadded

http://zone.ni.com/devzone/cda/tut/p/id/4880 Page 3 of 5

Zero Padding Does Not Buy Spectral Resolution - Developer Zone - National Instruments

1/21/12 3:12 AM

Padding does not help distinguish closely spaced peaks when your original input signal lacks sufficient frequency domain resolution. The figure above presents the case where the input signal lacks sufficient frequency distinguishing resolution. As the figure shows, the padded and nonpadded results show no hint at two peaks. Zero padding does not improve the resolution associated with your input signal -- the only way to do this is to increase the time duration of the block of signal that you examine. It is useful to remember that the best-case frequency resolution associated with the content of the signal that you measure is 1/T, where T is the time duration that your original, or nonpadded input samples cover. Zero Padding with LabVIEW As a general-purpose programming language, LabVIEW offers unlimited possibilities for zero padding associated with spectral analysis. This section narrows the possibilities down to a select subset. Download the examples discussed in this section.

Perhaps the most obvious is the built-in subVI from the array-based signal processing palette, "Zero Padder": This VI is a good choice for efficiently increasing an array length to the next higher power-of-two. The benefit is that the array-based FFT algorithms that ship with LabVIEW Full or Pro are more efficient with array lengths that are equal to a power of two. Padding an array with zeros to an arbitrary length requires a custom solution. The VI "zeroPadArrayarbitraryLength.vi" from the library associated with this article does the job for an array, and the code is straightforward. If you are new to LabVIEW, note the use of the initialize array operation in the LabVIEW code for this VI. It is an efficient alternative to building an array on the border of a For loop. If you are working with LabVIEW 6i (or higher) and familiar with the waveform data type (WFD) that was new to that release, you will note that the "Zero Padder" is designed for array-based inputs and outputs. The VIs in the attached library, "subPadWFDarbitrarylength.vi" and "subPadWFDPowerofTwoLength.vi" do the job for the WFD. The LabVIEW code is straighforward:

http://zone.ni.com/devzone/cda/tut/p/id/4880

Page 4 of 5

Zero Padding Does Not Buy Spectral Resolution - Developer Zone - National Instruments

1/21/12 3:12 AM

When you work with the WFD, you want to utilize the high-level tools for spectral analysis including the FFT Power Spectrum and several others. These VIs will not realize their inputs have been zero padded, so you will need to tweak them in certain circumstances. One area that you need to consider involves windowing. Enabling the built-in windowing capabilities for any of these VIs applies the window to the entire block of the input signal. As such, you will not want to apply it to a block that you have padded. To deal with this solution, you can ignore the windowing capabilities of these tools and apply any required windowing externally, as shown in the example VI, "WFDPSDExample.vi." Because zero padding does not affect the input sampling rate, these VIs automatically handle frequency scaling after padding. If you examine "WFDPSDExample.vi", you will see that the LabVIEW high-level FFT Power Spectral Density vi automatically handles the x-axis scaling. (The other high-level FFT-based WFD spectral analysis VIs can also handle this scaling.) I would like to thank several other engineers here at National Instruments for their ideas and technical review of this article: Mike Cerna, Jim Lewis, Jim Nagle, and Yong Rao.

Legal This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).

http://zone.ni.com/devzone/cda/tut/p/id/4880

Page 5 of 5

- EN 60068-2-27Uploaded byRaki Rock
- RVSPUploaded byAzeezShaik
- Agilent Spectrum analyzer basics an150Uploaded byDipak Patel
- Matlab - Theory - Fourier Analysis.pdfUploaded byMaikel Pérez Navarro
- FourierUploaded byIssen Sobri
- High-precision Harmonic Detection in ConvolutionUploaded bySEP-Publisher
- FftUploaded byveeramaniks408
- 2D-FFTUploaded byAngel Mariano
- 1.IJAEST Vol No 7 Issue No 1 FPGA Implementation of 2 D DCT for JPEG Image Compression 001 009Uploaded byhelpdesk9532
- Implementation of the Six Channel Redundancy to achieve fault tolerance in testing of satellitesUploaded byijcsis
- Simulation of Parallel Pipeline Radix 2^2 ArchitectureUploaded byEditor IJRITCC
- DSP Notes.pdfUploaded byKiranmai Srinivasulu
- vmUploaded byLam Teja Chowdary
- ANALIZADOR ESPECTRO 5952-0292.pdfUploaded byPablo Medina
- DSPUploaded byAbhinav Malhotra
- Harmonics MeasurmentUploaded bykashif
- 552_Notes_6cUploaded byEdwin Urrea Gómez
- Communication EngineeringUploaded byNamanPatel
- Wcee12 2000 Auckland Varpasuo Paper1Uploaded bydavid david david
- Fft NoiseUploaded bytaifour
- 33_2.pdfUploaded byYusufAdiN
- 01Uploaded byShih-Syuan Huang
- IV SEMESTER - 16.01.2018 (1)Uploaded byYo Yo Anand
- Article AimerstftpdfUploaded bybendiazz3430
- ANÁLISE TEMPORAL DO SPATIAL POWER SPECTRA DE DIFERENTES IMAGENSUploaded byCarlos Castro
- Some Digital Signal Processing Techniques for IM DiagnosisUploaded byZhang Jidong
- 30-280NUploaded byAmesh Lal Tvm
- Phys 229 Assignment.pdfUploaded byCas
- Static/dynamic contact FEA and experimental study for tooth profile modification of helical gears†Uploaded byanmol6237
- 2Uploaded bymohamed-gamaa

- OPTOCOUPLER DEVICESUploaded byjimdigriz
- newtons water rocket challenge student packetUploaded byapi-293162935
- Candle WikiUploaded byLuis G. Abbadie
- Java Cheat SheetUploaded byBalasubramanian Sankaranarayanan
- Effects of Extrusion Blow Molding Internal CoolingUploaded byJose Guerrero
- parts__service_manual_-_usats_-_isuzu_diesel.pdfUploaded byCesar
- EarthScienceModuleAllActivities.txtUploaded byNhikiMhaeGadorPalanas
- CADsoft Consulting Course Outline - Civil 3D 2012 for SurveyorsUploaded byCADsoft Consulting
- AmplifierUploaded byAnonymous GcalMc0Ex
- CS6212 - PDS1 Lab Manual_2013_regulationUploaded bysureshobi
- msds_microbial1.pdfUploaded byVanGoghVincent
- Wire RopeUploaded byDiego Fuentes Román
- 17537 - Audio Video EngineeringUploaded byAnonymous mNQq7oj
- Where Are the Cyborgs in Cybernetics?Uploaded byfreiheit137174
- Level Management EHandbook_Chemical ProcessingUploaded byAzar Deen
- Giuseppe Longo and Pierre-Emmanuel Tendero- The differential method and the causal incompleteness of Programming Theory in Molecular BiologyUploaded byYopghm698
- Case Study - Contrasting Psychodrama & Systemic Constellation WorkUploaded byKaren Carnabucci
- Welding InspectionUploaded byPeter Beckwith
- Online Shopping Project ReportUploaded byAmit Verma
- PS 2A03: Conflict Transformation — Course Guide (2010)Uploaded byDr Colin Salter
- Harold Lasswell's Problem Orientation.pdfUploaded byImdad Hussain
- M_ Sc Garment Manufacturing Technology(GMT)(Scheme & Syllabus 1st to 4th Sem)Uploaded byMohammad Zahirul Islam
- 42 UtilizationUploaded byWajihah Lazri
- My Today and YesterdayUploaded byBasil Fletcher
- Clinical Trials SucessUploaded bysreeraj.guruvayoor
- Lemon BatteryUploaded byMohammed Asif
- Basic 2G Parameter TrainingUploaded byambroserf
- Chapter 7 - Identifying Market Segments and TargetsUploaded byArman
- ubdUploaded byMark Abion Valladolid
- 1 Phase to 3 PhaseUploaded byRaghvendra Deshpande

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.