Fundamental theorem of asset pricing: Difference between revisions
en>Zfeinst |
change link |
||
Line 1: | Line 1: | ||
In [[signal processing]], a '''finite impulse response (FIR)''' filter is a [[filter (signal processing)|filter]] whose [[impulse response]] (or response to any finite length input) is of ''finite'' duration, because it settles to zero in finite time. This is in contrast to [[infinite impulse response]] (IIR) filters, which may have internal feedback and may continue to respond indefinitely (usually decaying). | |||
The [[impulse response]] of an Nth-order discrete-time FIR filter (i.e., with a [[Kronecker delta]] impulse input) lasts for ''N'' + 1 samples, and then settles to zero. | |||
FIR filters can be [[discrete-time]] or [[continuous-time]], and [[Digital data|digital]] or [[analog circuits|analog]]. | |||
==Definition== | |||
[[File:FIR Filter.svg|thumb|300px|right|A discrete-time FIR filter of order ''N''. The top part is an ''N''-stage delay line with ''N'' + 1 taps. Each unit delay is a ''z''<sup>−1</sup> operator in [[Z-transform]] notation.]] | |||
The output ''y'' of a linear time invariant system is determined by [[convolution|convolving]] its input signal ''x'' with its [[impulse response]] ''b''. | |||
For a [[discrete-time]] FIR filter, the output is a weighted sum of the current and a finite number of previous values of the input. The operation is described by the following equation, which defines the output sequence ''y[n]'' in terms of its input sequence ''x[n]'': | |||
:<math>\begin{align} | |||
y[n] &= b_0 x[n] + b_1 x[n-1] + \cdots + b_N x[n-N] \\ | |||
&= \sum_{i=0}^{N} b_i x[n-i] | |||
\end{align}</math> | |||
where: | |||
*<math>\scriptstyle x[n]</math> is the input signal, | |||
*<math>\scriptstyle y[n]</math> is the output signal, | |||
*<math>\scriptstyle b_{i}</math> are the ''filter coefficients'', also known as ''tap weights'', that make up the impulse response, | |||
*<math>\scriptstyle N</math> is the filter order; an <math>\scriptstyle N</math>th-order filter has <math>\scriptstyle (N \,+\, 1)</math> terms on the right-hand side. The <math>\scriptstyle x[n-i]</math> in these terms are commonly referred to as ''{{visible anchor|tap}}s'', based on the structure of a [[Digital delay line|tapped delay line]] that in many implementations or block diagrams provides the delayed inputs to the multiplication operations. One may speak of a ''5th order/6-tap filter'', for instance. | |||
==Properties== | |||
A FIR filter has a number of useful properties which sometimes make it preferable to an [[infinite impulse response]] (IIR) filter. FIR filters: | |||
*Require no feedback. This means that any rounding errors are not compounded by summed iterations. The same relative error occurs in each calculation. This also makes implementation simpler. | |||
*Are inherently stable. This is due to the fact that, because there is no required feedback, all the poles are located at the origin and thus are located within the unit circle (the required condition for stability in a discrete, linear-time invariant system). | |||
*They can easily be designed to be [[linear phase]] by making the coefficient sequence symmetric. This property is sometimes desired for phase-sensitive applications, for example data communications, [[Audio crossover|crossover filters]], and [[Audio mastering|mastering]]. | |||
The main disadvantage of FIR filters is that considerably more computation power in a general purpose processor is required compared to an IIR filter with similar sharpness or [[selectivity (electronic)|selectivity]], especially when low frequency (relative to the sample rate) cutoffs are needed. However many digital signal processors provide specialized hardware features to make FIR filters approximately as efficient as IIR for many applications. | |||
==Impulse response== | |||
The [[impulse response]] <math>\scriptstyle h[n]</math> can be calculated if we set <math>\scriptstyle x[n] \;=\; \delta[n]</math> in the above relation, where <math>\scriptstyle \delta[n]</math> is the [[Kronecker delta#Digital signal processing|Kronecker delta]] impulse. The impulse response for an FIR filter then becomes the set of coefficients <math>\scriptstyle b_n</math>, as follows | |||
:<math>h[n] = \sum_{i=0}^{N}b_i \delta[n-i] = b_n</math> | |||
for <math>\scriptstyle n \;=\; 0</math> to <math>\scriptstyle N</math>. | |||
The [[Z-transform]] of the impulse response yields the [[transfer function]] of the FIR filter | |||
:<math> | |||
\begin{align} | |||
H(z) &= Z\{h[n]\} \\ | |||
&= \sum_{n=-\infty}^{\infty} h[n] z^{-n} \\ | |||
&= \sum_{n=0}^{N}b_n\,z^{-n} | |||
\end{align} | |||
</math> | |||
FIR filters are clearly [[BIBO stability|''bounded-input bounded-output'' (BIBO) stable]], since the output is a sum of a finite number of finite multiples of the input values, so can be no greater than <math>\scriptstyle \sum |b_i|</math> times the largest value appearing in the input. | |||
==Filter design== | |||
To design a filter means to select the coefficients such that the system has specific characteristics. The required characteristics are stated in filter specifications. Most of the time filter specifications refer to the frequency response of the filter. There are different methods to find the coefficients from frequency specifications: | |||
# [[#Window design method|Window design method]] | |||
# Frequency Sampling method | |||
# [[Least squares#Weighted least squares|Weighted least squares design]] | |||
# [[Parks-McClellan method]] (also known as the Equiripple, Optimal, or Minimax method). The [[Remez algorithm|Remez exchange algorithm]] is commonly used to find an optimal equiripple set of coefficients. Here the user specifies a desired frequency response, a weighting function for errors from this response, and a filter order ''N''. The algorithm then finds the set of <math>\scriptstyle (N \,+\, 1)</math> coefficients that minimize the maximum deviation from the ideal. Intuitively, this finds the filter that is as close as you can get to the desired response given that you can use only <math>\scriptstyle (N \,+\, 1)</math> coefficients. This method is particularly easy in practice since at least one text<ref>Rabiner, Lawrence R., and Gold, Bernard, 1975: Theory and Application of Digital Signal Processing (Englewood Cliffs, New Jersey: Prentice-Hall, Inc.) ISBN 0-13-914101-4</ref> includes a program that takes the desired filter and ''N'', and returns the optimum coefficients. | |||
# Equiripple FIR filters can be designed using the FFT algorithms as well.<ref>A. E. Cetin, O.N. Gerek, Y. Yardimci, "Equiripple FIR filter design by the FFT algorithm," IEEE Signal Processing Magazine, pp. 60-64, March 1997.</ref> The algorithm is iterative in nature. You simply compute the DFT of an initial filter design that you have using the FFT algorithm (if you don't have an initial estimate you can start with h[n]=delta[n]). In the Fourier domain or FFT domain you correct the frequency response according to your desired specs and compute the inverse FFT. In time-domain you retain only N of the coefficients (force the other coefficients to zero). Compute the FFT once again. Correct the frequency response according to specs. | |||
Software packages like [[MATLAB]], [[GNU Octave]], [[Scilab]], and [[SciPy]] provide convenient ways to apply these different methods. | |||
Some filter specifications refer to the time-domain shape of the input signal the filter is expected to "recognize". The optimum [[matched filter]] for separating any waveform from white noise is obtained by sampling that shape and using those samples in reverse order as the coefficients of the filter — giving the filter an impulse response that is the time-reverse of the expected input signal. | |||
=== Window design method === | |||
In the window design method, one first designs an ideal IIR filter and then truncates the infinite impulse response by multiplying it with a finite length [[window function]]. The result is a finite impulse response filter whose frequency response is modified from that of the IIR filter. Multiplying the infinite impulse by the window function in the time domain results in the frequency response of the IIR being [[convolved]] with the frequency response of the window function. If the window's main lobe is narrow, then the frequency response resulting FIR filter will be close to that of the ideal IIR filter. | |||
If the ideal response is sufficiently simple, such as rectangular, the result of the convolution can be relatively easy to determine. In fact one usually specifies the desired result first and works backward to determine the appropriate window function parameter(s).{{explain}} Kaiser windows are particularly well-suited for this method because of their closed form specifications. | |||
==Moving average example== | |||
{{multiple image | |||
| direction = vertical | |||
| width = 300 | |||
| footer = | |||
| image1 = FIR Filter (Moving Average).svg | |||
| alt1 = Fig. (a) Block diagram of a simple FIR filter (2nd-order/3-tap filter in this case, implementing a moving average) | |||
| caption1 = Fig. (a) Block diagram of a simple FIR filter (2nd-order/3-tap filter in this case, implementing a moving average) | |||
| image2 = MA2PoleZero C.svg | |||
| alt2 = Fig. (b) Pole-Zero Diagram | |||
| caption2 = Fig. (b) Pole-Zero Diagram | |||
| image3 = MA2Amp C.svg | |||
| alt3 = Fig. (c) Amplitude and phase responses | |||
| caption3 = Fig. (c) Amplitude and phase responses | |||
}} | |||
A [[moving average]] filter is a very simple FIR filter. It is sometimes called a [[Boxcar function|boxcar]] filter, especially when followed by [[Decimation (signal processing)|decimation]]. The filter coefficients, <math>\scriptstyle b_0,\, \dots,\, b_N</math>, are found via the following equation: | |||
:<math>b_{i}=\frac{1}{N+1}</math> | |||
To provide a more specific example, we select the filter order: | |||
:<math>N = 2</math> | |||
The impulse response of the resulting filter is: | |||
:<math>h[n] = \frac{1}{3}\delta[n] + \frac{1}{3}\delta[n-1] + \frac{1}{3}\delta[n-2]</math> | |||
The Fig. (a) on the right shows the block diagram of a 2nd-order moving-average filter discussed below. To discuss stability and spectral topics we take the [[z-transform]] of the impulse response: | |||
:<math>H(z) = \frac{1}{3} + \frac{1}{3}z^{-1} + \frac{1}{3}z^{-2} = \frac{1}{3}\frac{z^{2} + z + 1}{z^{2}}</math> | |||
Fig. (b) on the right shows the pole-zero diagram of the filter. Zero frequency (DC) corresponds to (1,0), positive frequencies advancing counterclockwise around the circle to (-1,0) at half the sample frequency. Two poles are located at the origin, and two zeros are located at <math>\scriptstyle z_{1} \;=\; -\frac{1}{2} \,+\, j\frac{\sqrt{3}}{2}</math>, <math>\scriptstyle z_{2} \;=\; -\frac{1}{2} \,-\, j\frac{\sqrt{3}}{2}</math>. | |||
The frequency response, for frequency ''ω'' in radians per sample, is: | |||
:<math>H\left(e^{j\omega}\right) = \frac{1}{3} + \frac{1}{3}e^{-j\omega} + \frac{1}{3}e^{-j2\omega}</math> | |||
Fig. (c) on the right shows the magnitude and phase plots of the frequency response. Clearly, the moving-average filter passes low frequencies with a gain near 1, and attenuates high frequencies. This is a typical [[low-pass filter]] characteristic. Frequencies above π are [[aliasing|aliases]] of the frequencies below π, and are generally ignored or filtered out if reconstructing a [[continuous-time]] signal. The following figure shows the [[phase response]]. Since the phase always follows a straight line except where it has been reduced modulo π radians (should be 2π), the linear phase property is demonstrated. | |||
==See also== | |||
*[[Electronic filter]] | |||
*[[Filter (signal processing)]] | |||
*[[Infinite impulse response|Infinite impulse response (IIR) filter]] | |||
*[[Z-transform]] (specifically [[Z-transform#Linear constant-coefficient difference equation|Linear constant-coefficient difference equation]]) | |||
*[[Filter design]] | |||
*[[Cascaded Integrator-Comb Filter]] | |||
*[[Compact support]] | |||
==References== | |||
<references/> | |||
==External links== | |||
*[http://cnx.org/content/col10553/latest/ Notes on the Optimal Design of FIR Filters] [[Connexions]] online book by John Treichler (2008). | |||
*[http://dspguru.com/dsp/faqs/fir FIR FAQ] provided by dspguru.com. | |||
*[http://www.ludd.luth.se/~torger/brutefir.html BruteFIR; Software for applying long FIR filters to multi-channel digital audio, either offline or in realtime.] | |||
*[http://freeverb3.sourceforge.net/ Freeverb3 Reverb Impulse Response Processor] | |||
* Worked examples and explanation for designing [http://www.labbookpages.co.uk/audio/firWindowing.html FIR filters using windowing]. Includes code examples. | |||
*[http://www.falstad.com/dfilter/ A JAVA applet with different FIR-filters]; the filters are applied to sound and the results can be heard immediately. The source code is also available. | |||
*[http://signal.ee.bilkent.edu.tr/my_filter.m Matlab code]; Matlab code for "Equiripple FIR filter design by the FFT algorithm" by A. Enis Cetin, O. N. Gerek and Y. Yardimci, IEEE Signal Processing Magazine, 1997. | |||
[[Category:Digital signal processing]] | |||
[[Category:Filter theory]] |
Revision as of 02:34, 10 January 2014
In signal processing, a finite impulse response (FIR) filter is a filter whose impulse response (or response to any finite length input) is of finite duration, because it settles to zero in finite time. This is in contrast to infinite impulse response (IIR) filters, which may have internal feedback and may continue to respond indefinitely (usually decaying).
The impulse response of an Nth-order discrete-time FIR filter (i.e., with a Kronecker delta impulse input) lasts for N + 1 samples, and then settles to zero.
FIR filters can be discrete-time or continuous-time, and digital or analog.
Definition
![](https://upload.wikimedia.org/wikipedia/commons/thumb/9/9b/FIR_Filter.svg/300px-FIR_Filter.svg.png)
The output y of a linear time invariant system is determined by convolving its input signal x with its impulse response b.
For a discrete-time FIR filter, the output is a weighted sum of the current and a finite number of previous values of the input. The operation is described by the following equation, which defines the output sequence y[n] in terms of its input sequence x[n]:
where:
- is the input signal,
- is the output signal,
- are the filter coefficients, also known as tap weights, that make up the impulse response,
- is the filter order; an th-order filter has terms on the right-hand side. The in these terms are commonly referred to as Template:Visible anchors, based on the structure of a tapped delay line that in many implementations or block diagrams provides the delayed inputs to the multiplication operations. One may speak of a 5th order/6-tap filter, for instance.
Properties
A FIR filter has a number of useful properties which sometimes make it preferable to an infinite impulse response (IIR) filter. FIR filters:
- Require no feedback. This means that any rounding errors are not compounded by summed iterations. The same relative error occurs in each calculation. This also makes implementation simpler.
- Are inherently stable. This is due to the fact that, because there is no required feedback, all the poles are located at the origin and thus are located within the unit circle (the required condition for stability in a discrete, linear-time invariant system).
- They can easily be designed to be linear phase by making the coefficient sequence symmetric. This property is sometimes desired for phase-sensitive applications, for example data communications, crossover filters, and mastering.
The main disadvantage of FIR filters is that considerably more computation power in a general purpose processor is required compared to an IIR filter with similar sharpness or selectivity, especially when low frequency (relative to the sample rate) cutoffs are needed. However many digital signal processors provide specialized hardware features to make FIR filters approximately as efficient as IIR for many applications.
Impulse response
The impulse response can be calculated if we set in the above relation, where is the Kronecker delta impulse. The impulse response for an FIR filter then becomes the set of coefficients , as follows
The Z-transform of the impulse response yields the transfer function of the FIR filter
FIR filters are clearly bounded-input bounded-output (BIBO) stable, since the output is a sum of a finite number of finite multiples of the input values, so can be no greater than times the largest value appearing in the input.
Filter design
To design a filter means to select the coefficients such that the system has specific characteristics. The required characteristics are stated in filter specifications. Most of the time filter specifications refer to the frequency response of the filter. There are different methods to find the coefficients from frequency specifications:
- Window design method
- Frequency Sampling method
- Weighted least squares design
- Parks-McClellan method (also known as the Equiripple, Optimal, or Minimax method). The Remez exchange algorithm is commonly used to find an optimal equiripple set of coefficients. Here the user specifies a desired frequency response, a weighting function for errors from this response, and a filter order N. The algorithm then finds the set of coefficients that minimize the maximum deviation from the ideal. Intuitively, this finds the filter that is as close as you can get to the desired response given that you can use only coefficients. This method is particularly easy in practice since at least one text[1] includes a program that takes the desired filter and N, and returns the optimum coefficients.
- Equiripple FIR filters can be designed using the FFT algorithms as well.[2] The algorithm is iterative in nature. You simply compute the DFT of an initial filter design that you have using the FFT algorithm (if you don't have an initial estimate you can start with h[n]=delta[n]). In the Fourier domain or FFT domain you correct the frequency response according to your desired specs and compute the inverse FFT. In time-domain you retain only N of the coefficients (force the other coefficients to zero). Compute the FFT once again. Correct the frequency response according to specs.
Software packages like MATLAB, GNU Octave, Scilab, and SciPy provide convenient ways to apply these different methods.
Some filter specifications refer to the time-domain shape of the input signal the filter is expected to "recognize". The optimum matched filter for separating any waveform from white noise is obtained by sampling that shape and using those samples in reverse order as the coefficients of the filter — giving the filter an impulse response that is the time-reverse of the expected input signal.
Window design method
In the window design method, one first designs an ideal IIR filter and then truncates the infinite impulse response by multiplying it with a finite length window function. The result is a finite impulse response filter whose frequency response is modified from that of the IIR filter. Multiplying the infinite impulse by the window function in the time domain results in the frequency response of the IIR being convolved with the frequency response of the window function. If the window's main lobe is narrow, then the frequency response resulting FIR filter will be close to that of the ideal IIR filter.
If the ideal response is sufficiently simple, such as rectangular, the result of the convolution can be relatively easy to determine. In fact one usually specifies the desired result first and works backward to determine the appropriate window function parameter(s).Template:Explain Kaiser windows are particularly well-suited for this method because of their closed form specifications.
Moving average example
People are nonetheless rushing to buy properties in Singapore. A new residential condominium mission in Bedok had a long queue three days before its official launch and bought more than 350 units on the very first day. Nonetheless, there is a ‘development' that had emerged in 2011 that the majority have possibly overlooked.
In August, more than a hundred individuals across 16 states reportedly had been sickened with salmonella after consuming mangos In September, the Meals and Drug Administration detained mango imports from a Mexican packing house after the fruits had been linked to the sickenings Save Cash On Your Online Purchasing Make saving money when purchasing on-line a breeze with Bodge's favourite app, Invisible Hands. This helpful program does the price-checking analysis for you, and will warn you when a unique site has a better value - or let you realize that you have found the most effective deal. Watch Posted by Edison Foo September 29, 2013 HEARTH SALE!!! From only $9xx,000! We hope this listing will help launch your search for new properties in Singapore. It's unlawful to purchase ice cream after 6 pm, in Newark.
for a borrower with one or more excellent residential property loans3; and No SSD will be payable by the seller if the property is bought more than three years after it was bought. Non-extension of the Jan 2009 Funds assistance measures for the property market when the measures expire. Permitting up to 2 years of property tax deferral for land accepted for improvement. Lively secondary marketplace for easy exit of property investments. Curiosity on mortgage fee is tax deductible when the property is rented out. We've progressive property tax rates for residential properties- the higher the value of the residential property, the upper the tax charge. Why do I've to pay property tax on my house when I'm an onwer-occupier and not deriving rental earnings? Palacio Cluster Landed
After obtaining a Sale License (topic to authorities circumstances meant to guard individuals shopping for property in Singapore), he might www.rmmonline.com proceed to sell units in his growth. Funding in the property market of Singapore is likely one of the few investment choices the place utilizing the bank's cash could not be any easier. The power of expats, to make a down payment, leverage the capital and consequently improve total return on investment, is excessive in Singapore. PRs who own a HDB flat must sell their flat inside six months of buying a non-public residential property in Singapore. EVERLASTING residents (PRs) now face unprecedented limits on their skill to purchase property in Singapore. New Condo in 2013 March Foreigners are eligible for Singapore greenback mortgage loan. housing grant
Skilled property brokers in Singapore will assist the client and defend their interests throughout the acquisition, and will help safe the provide at the best possible price. The agents may even be sure that all paperwork are in order and that the vendor is the rightful proprietor of the property. Most of the property brokers share their databases with each other. Tuesday's measures come after the Monetary Authority of Singapore in June tightened rules on property loans, and closed loopholes that allowed some householders to circumvent loan restrictions and avoid paying levies when buying extra property. Contact us for a FREE housing loan analysis and to study concerning the newest mortgage to worth on Singapore housing loans. J Gateway Condominium (Bought Out) Oct, 2013
6. Completion of automotive park, roads and drains serving the housing project 5% 7. Notice of Vacant Possession (Upon obtaining Temporary Occupation Permit) The estimates given by SingaporeHousingLoan.SG's calculator are not quotations and are usually not binding in any way on SingaporeHousingLoan.sg or the consumer. The method of calculation does not exactly mirror that of which is being used by the individual monetary establishment and the data provided should be used as a information only. SingaporeHousingLoan.SG's calculator does not pre-qualify you for any housing loan from any monetary institution. Undercover Report Finds Unlawful Rat Meat Sold In London Market Unpasteurized Tempeh Linked To Salmonella Outbreak That Sickens 60 Hottest EC Launch in Sengkang!
BuyRentSingaporeProperty.com is dedicated in providing the newest residential launches, Developer's sales, new launches, resale, HIGH tasks and rental of properties in Singapore. Then there are new launch property condos in the mid-tier range. These are sometimes in the vicinity of the city fringe, in areas corresponding to Newton and Novena Tanjong Rhu. These new launch projects are popular due to their proximity to town heart, the place the enterprise and entertainment centers and all the amenities they provide, but they're usually cheaper than the City core region tasks. Why submit cheques to register for new property launches in Singapore? Riversails Apartment @ Higher Serangoon LakeVille @ Jurong Lakeside Condo by MCL Ferra Condo @ Leonie Hill
A moving average filter is a very simple FIR filter. It is sometimes called a boxcar filter, especially when followed by decimation. The filter coefficients, , are found via the following equation:
To provide a more specific example, we select the filter order:
The impulse response of the resulting filter is:
The Fig. (a) on the right shows the block diagram of a 2nd-order moving-average filter discussed below. To discuss stability and spectral topics we take the z-transform of the impulse response:
Fig. (b) on the right shows the pole-zero diagram of the filter. Zero frequency (DC) corresponds to (1,0), positive frequencies advancing counterclockwise around the circle to (-1,0) at half the sample frequency. Two poles are located at the origin, and two zeros are located at , .
The frequency response, for frequency ω in radians per sample, is:
Fig. (c) on the right shows the magnitude and phase plots of the frequency response. Clearly, the moving-average filter passes low frequencies with a gain near 1, and attenuates high frequencies. This is a typical low-pass filter characteristic. Frequencies above π are aliases of the frequencies below π, and are generally ignored or filtered out if reconstructing a continuous-time signal. The following figure shows the phase response. Since the phase always follows a straight line except where it has been reduced modulo π radians (should be 2π), the linear phase property is demonstrated.
See also
- Electronic filter
- Filter (signal processing)
- Infinite impulse response (IIR) filter
- Z-transform (specifically Linear constant-coefficient difference equation)
- Filter design
- Cascaded Integrator-Comb Filter
- Compact support
References
- ↑ Rabiner, Lawrence R., and Gold, Bernard, 1975: Theory and Application of Digital Signal Processing (Englewood Cliffs, New Jersey: Prentice-Hall, Inc.) ISBN 0-13-914101-4
- ↑ A. E. Cetin, O.N. Gerek, Y. Yardimci, "Equiripple FIR filter design by the FFT algorithm," IEEE Signal Processing Magazine, pp. 60-64, March 1997.
External links
- Notes on the Optimal Design of FIR Filters Connexions online book by John Treichler (2008).
- FIR FAQ provided by dspguru.com.
- BruteFIR; Software for applying long FIR filters to multi-channel digital audio, either offline or in realtime.
- Freeverb3 Reverb Impulse Response Processor
- Worked examples and explanation for designing FIR filters using windowing. Includes code examples.
- A JAVA applet with different FIR-filters; the filters are applied to sound and the results can be heard immediately. The source code is also available.
- Matlab code; Matlab code for "Equiripple FIR filter design by the FFT algorithm" by A. Enis Cetin, O. N. Gerek and Y. Yardimci, IEEE Signal Processing Magazine, 1997.