The present invention relates to a digital filter designing method and a designing device, specifically to a designing method of an FIR filter.
As one form of digital filters, there is a finite impulse response (FIR) filter. The FIR filter having a tapped delay line which comprises a plurality of delay devices is one type of filters which multiplies output signals of each tap several-fold using the filter coefficients and adds up the multiplied results to be outputted. There are two advantages in such FIR filter. Firstly, a circuit is constantly stable because the pole of transfer function of the FIR filter exists only at an origin point on Z plane. Secondary, linearly phase characteristics with complete accuracy can be achieved if the filter coefficients are symmetric.
In the FIR filter, an impulse response represented by finite time length itself constitutes filter coefficients as are. Therefore, designing the FIR filter is equal to determine the filter coefficients so that the desired frequency characteristic is obtained. As conventional steps of designing an FIR filter, filter coefficients are calculated based on a targeted frequency characteristic, followed by a window function processing to obtain the finite number of coefficient group. Then, the obtained coefficient group is subjected to a fast Fourier transform (FFT) to be converted to the frequency characteristic and it is checked whether the characteristic satisfies the targeted values or not.
When the filter coefficients are calculated from the targeted frequency characteristic, for example, a convolution calculation using Chebyshev approximation or the like is performed based on a ratio between a sampling frequency and a cutoff frequency. However, since the frequency characteristic of the FIR filter obtained by a conventional designing method is in dependence on a window function and an approximation formula, the preferable targeted frequency characteristic cannot be obtained unless the window function and the approximation formula are appropriately set. However, it is generally difficult to set the appropriate window function and approximation formula. Moreover, the window function processing causes the discretization error of coefficients. For these reasons, it is extremely difficult to attain the desired frequency characteristic.
A method for adjusting a filter bank band by inserting one or more zero values each between taps (filter coefficients) of a tapped delay line has been known (see Japanese Publication of PCT Application No. H6-503450, for example). Besides, a method for realizing precipitous frequency characteristic using a plurality of FIR filters being cascade-connected has been known (see Japanese Patent Application Laid-open No. H5-243908, for example). However, even using one of these methods can only narrow the passband of the filter, and cannot realize the precise frequency characteristic of an arbitrary shape.
The present invention has been implemented to solve these problems and it is an object of the present invention to design a digital filter required precise frequency characteristic in an arbitrary shape through a simple processing.
In order to solve the above-mentioned problems, a digital filter designing method of the present invention comprises a first step of generating a plurality of frequency-shifted filters, through a frequency shift calculation to a basic filter which realizes frequency/amplitude characteristic having a passband width determined by dividing a sampling frequency by an integer, which realizes the frequency/amplitude characteristics obtained from the frequency/amplitude characteristics of the basic filter being shifted by a prescribed frequency so that the adjacent filter banks are overlapped each other at the part of one-half amplitude and a second step of obtaining filter coefficients of the digital filter as a final product by summing the filter coefficients of one or more arbitrary filters extracted among a plurality of filters including the basic filter and the frequency-shifted filters.
Furthermore, a digital filter designing device of the present invention comprises a coefficient table storage means for storing a table data of filter coefficient group including filter coefficients of a basic filter which realizes frequency/amplitude characteristic having a passband width determined by dividing a sampling frequency by an integer and filter coefficients of a plurality of frequency-shifted filters which realizes the frequency/amplitude characteristics obtained from the frequency/amplitude characteristics of the basic filter being shifted by a prescribed frequency so that the adjacent filter banks are overlapped each other at the part of one-half amplitude and a calculation means for obtaining filter coefficients of the digital filter as a final product by summing filter coefficients of one or more filters designated among the filter coefficient group stored in the coefficient table storage means.
According to the present invention comprising the above-mentioned configuration, an FIR digital filter having frequency/amplitude characteristic in an arbitrary shape can be precisely designed through an extremely simple processing of summing the filter coefficients of one or more desired filters selected from a basic filter and a plurality of frequency-shifted filters generated from the basic filter.
One embodiment of the present invention will be explained below referring to drawings.
Then, by performing a frequency shift calculation for the basic filter having frequency/amplitude characteristic as shown in
Providing that a filter coefficient sequence of the basic filter is {H−i0, H−(i−1)0, H−(i−2)0, . . . , H−10, H00, H10, . . . , Hi−20, Hi−10, Hi0} (which is a symmetric type with a coefficient of H00 as a center) and a filter coefficient sequence of kth frequency-shifted filter counted from the basic filter (obtained from the frequency/amplitude characteristic of the basic filter being frequency shifted by “a prescribed frequency×k”) is {H−ik, H−(i−1)k, H−(i−2)k, . . . , H−1k, H0k, H1k, . . . , Hi−2k, Hi−1k, Hik}, the coefficient Hjk with a coefficient number of j (j=−i, −(i−1), −(i−2), . . . , −1, 0, 1, . . . , i−2, i−1, i) in the kth frequency-shifted filter is determined by using the following formula:
Hjk=Hj0×2 cos(2πkj/(n/2))
For example, the coefficient H−ik with a coefficient number of −i in the kth frequency-shifted filter is determined by using the following formula:
H−ik=H−i0×2 cos(2πk×(−i)/(n/2))
Also, the coefficient H−(i−1)k with a coefficient number of −(i−1) is determined by using the following formula:
H−(i−1)k=H−(i−1)0×2 cos(2πk×(−(i−1))/(n/2))
The other coefficients {H−(i−2)k, . . . , H−1k, H0k, H1k, . . . , Hi−2k, Hi−1k, Hik} are also determined through the same calculation.
By extracting one or more arbitrary filters from a plurality of filters produced by the above steps S1 and S2 and summing correspondent filter coefficients thereof in each coefficient number, the final filter coefficients are obtained (step S3). For example, when kth frequency-shifted filter and (k+1)th frequency-shifted filter counted from the basic filter are added together, the targeted filter coefficients are determined as follows:
{H−ik+H−ik+1, H−(i−1)k+H−(i−1)k+1, H−(i−2)k+H−(i−2)k+1, . . . , H−1k+H−1k+1, H0k+H0k+1, H1k+H1k+1, . . . , Hi−2k+Hi−2k+1, Hi−1k+Hi−1k+1, Hik+Hik+1}
Since adjacent filters are produced so that filter banks are overlapped precisely in the part of one-half amplitude, the amplitude becomes exactly “1” when the filter coefficients thereof are added together. As a result, the top of a passband of the resulting filter is flatted. Therefore, when 32 filter coefficients corresponding to k=0-31 are added together, each top of the 32 filters is flatted, and a passband with a bandwidth of (fs/2/128)×32 is obtained. As a filter corresponding to k=32 is not a target to be added together, a trap is occurred in its part. Moreover, when the coefficients of six filters corresponding to k=33-38 are added together, each top of the six filters is flatted, and a passband having a bandwidth of (fs/2/128)×6 is obtained. Thus, a low pass filter in a particular form having the passband in the part of k=0-38 and the trap in the part of k=32 can be obtained.
The producing method of the basic filter in the above step S1 will be explained in details. In the present invention, there is no particular limitation to the producing method of the basic filter and various producing methods are applicable.
As shown in
Therefore, when the number of “0” to be inserted is 127, frequency/amplitude characteristic of a low pass filter having passbands each with a bandwidth determined by dividing a half sampling frequency fs into 128 is obtained. However, as the frequency characteristic is a continuous wave wherein 128 passbands exist in the band lower than the center frequency, the frequency characteristic of a single wave constituting the basic filter such as in
For performing the cutout of a single wave, a window filter WF as shown in
In the present invention, the producing method of the window filter WF is not particularly limited and a variety of producing methods is applicable. As one example, there is a method comprising steps of inputting a plurality of amplitude values expressing frequency characteristic of a window filter WF and of performing inverse Fourier transform to the inputted numeric sequence. As well known, by performing fast Fourier transform (FFT) to a numeric sequence, a waveform of frequency/amplitude characteristic corresponding to the numeric sequence can be obtained. Therefore, an original numeric sequence required to attain the desired frequency/amplitude characteristic can be obtained by inputting a numeric sequence expressing a waveform of the desired frequency/amplitude characteristic, performing inverse FFT to the inputted numeric sequence, and extracting the real number thereof. This numeric sequence is equivalent of filter coefficients of the targeted window filter WF.
Fundamentally, the infinite number of filter coefficients as well as the infinite number of filter taps is required to constitute an ideal filter. Therefore, it is preferable to increase the number of input data corresponding to the number of filter coefficients to the degree that a frequency error to the desired frequency is within the required range in order to decrease the error. However, regarding the window filter WF, only the whole passband of the basic filter is required to be included in the passband and no more precision is demanded. Therefore, the number of input data of a numeric sequence (the number of filter coefficients of a window filter WF) need not be increased so much. The number of filter coefficients can be further reduced by additional window function processing and the like to the filter coefficients obtained by the inverse FFT calculation.
In the input of amplitude values which expresses frequency characteristic of the window filter WF, numeric values at individual sample points may be inputted directly or after drawing a waveform of the desired frequency characteristic in a two dimensional input coordinate for indicating the frequency/amplitude characteristic, the numeric values of the numeric sequence replaced from the drawn waveform may be inputted. By using the latter input method, the input of the data indicating the desired frequency characteristic can be easily performed through intuition while verifying the desired frequency characteristic as an image.
There are some possible ways for accomplishing the latter input method. For example, there is a method comprising steps of displaying a two dimensional plane indicating frequency/amplitude characteristic on a display screen of a computer, drawing a waveform of the desired frequency characteristic on the two dimensional plane by a graphical user interface (GUI) and the like, and converting the drawn waveform into the numeric data. A pointing device such as a digitizer or plotter may be used instead of the GUI on the computer screen. The method explained here is an example and the other method may be used for inputting the numeric sequence. Besides, the desired frequency/amplitude characteristic is inputted as the numeric sequence in the example, the characteristics may be inputted as a function representing a waveform of the characteristic.
The cascade connection of the filter in the step S13 can be performed by calculation of the filter coefficients as mentioned below.
For the filter coefficients of the window filter WF in the convolution calculation, all the sequential numeric values {H−m, H−(m−1), . . . , H−1, H0, H1, . . . , Hm−1, Hm} are the fixed target of multiplication and addition. On the other hand, for the filter coefficients of the basic unit filter L127, zero values are assumed to exist before and after the numeric sequence {−1, 0, . . . , 9, 0, . . . , 16, 0, . . . , 9, 0, . . . , −1} and (2 m+1) sequential numeric values including the zero values are the target of the convolution calculation.
When xth numeric value is determined in filter coefficients of the basic filter, the target of multiplication and addition is (2 m+1) sequential numeric values comprising xth numeric value and numeric values preceding the same in the filter coefficients of the basic unit filter L127. For example, when first numeric value in the filter coefficients of the basic filter is determined, the numeric sequence of all the filter coefficients of the window filter WF {H−m, H−(m−1), . . . , H−1, H0, H1, . . . , Hm−1, Hm} (the sequence circled with the dotted line represented by 31) and (2 m+1) sequential numeric values including the first numeric value of the filter coefficients of the basic unit filter L127 and numeric values preceding the first numeric value {0, 0, . . . , 0, −1} (the numeric sequence circled with the dotted line represented by 32) are the target and the calculation is performed to determine the total of the multiplied elements corresponding in the sequence. The result of this calculation becomes ((−1)×H−m).
When the second numeric value in the filter coefficients of the basic filter is determined, the numeric sequence of all the filter coefficients of the window filter WF {Hm, H−(m−1), . . . , H−1, H0, . . . , Hm−1, Hm} (the sequence circled with the dotted line represented by 31) and (2 m+1) sequential numeric values including second numeric value of the filter coefficients of the basic unit filter L127 and numeric values preceding the second numeric value {0, 0, . . . , 0, −1, 0} (the sequence circled with the dotted line represented by 33) are the target and the calculation is performed to determined the total of the multiplied elements corresponding in the sequence. In this instance, the result of this calculation is ((−1)×H−m+0×H−(m−1)). The (2×(2 m+1)−1) sequential numeric values constituting the filter coefficients of the basic filter are determined in the same way.
By inputting the amplitude values expressing the frequency characteristic of the basic filter and performing invert FFT, the filter coefficients of the basic filter can be directly determined. However, in order to constitute an ideal basic filter with invert FFT (to decrease the error with the desired frequency characteristic), the number of input data corresponding to the filter coefficients need to be extremely increased. This result in the enormous number of filter coefficients constituting the basic filter as well as the enormous number of filter coefficients as the final product produced utilizing the filter coefficients constituting the basic filter. Therefore, if the number of filter coefficients is desired to be decreased as small as possible, it is preferable to produce the basic filter using the window filter WF as mentioned above.
After determining the filter coefficients of the basic filter, filter coefficients of a plurality of frequency-shifted filters are further determined with the frequency shift calculation. Then, one or more arbitrary filters are extracted from the basic filter and a plurality of frequency-shifted filters and the filter coefficients thereof are added together in each corresponding coefficient number to determine the final filter coefficients. By arbitrary changing the filters to be extracted, a digital filter having arbitrary frequency characteristic can be produced.
Although an example for producing the low pass filter partly having the trap is shown in
13 is an operation part for selecting one or more arbitrary filters from the basic filter and a plurality of frequency-shifted filters. The operation part 13 comprises, for example, input devices such as a key board or a mouse. 14 is a display part to display a selection screen when one or more arbitrary filters are selected. In the selection screen, the row numbers of the filter coefficient table 11 may be displayed to be selected, or a waveform of the frequency characteristics such as in
15 is a calculation part to determine the filter coefficients of the FIR digital filter through an addition, in each corresponding coefficient number, of the filter coefficients (read out from the filter coefficient table 11 by the controller 12) of filters selected from the basic filter and a plurality of frequency-shifted filters by the operation part 13. In the digital filter designing device of the present embodiment, the filter coefficients of the basic filter and a plurality of frequency-shifted filters are obtained and converted into the table data in advance. Thus, the desired digital filter can be designed through an extremely simple calculation which is the addition of the filter coefficients of the filters selected by the user's operation of the operation part 13.
As mentioned above in details, according to the present embodiment, an FIR digital filter required precise frequency characteristic can be designed with an extremely simple way.
Although the example using {−1, 0, 9, 16, 9, 0, −1} as a numeric sequence of filter coefficients of the basic unit filter is explained in the above embodiment, it is not construed as limiting the present invention. Any numeric sequence in a symmetric type is applicable in the present invention.
Besides, in the above embodiment, although the example wherein the low pass filter used as the basic filter is frequency shifted to the high frequency side is explained, it is not construed as limiting the present invention. A high pass filter used as the basic filter may be frequency shifted to the low frequency side and a band pass filter used as the basic filter may be frequency shifted to the high frequency side and low frequency side.
By the way, the above-described embodiment is not more than a specific example in implementing the present invention and this should not be interpreted as restricting the technological scope of the present invention. That is, the invention may be embodied in other specific forms without departing from the spirit or essential characteristic thereof.
The present invention is useful for designing an FIR digital filter as a type for comprising a tapped delay line which comprises a plurality of delay devices and for outputting the sum of results obtained by multiplying output signals of each tap several-fold by using each filter coefficient.
Number | Date | Country | Kind |
---|---|---|---|
2003-415517 | Dec 2003 | JP | national |
This application is a continuation under 35 U.S.C. § 120 of International PCT/JP2004/010585 filed on Jul. 20, 20045. International application PCT/JP2004/010585 claims priority to Japanese application 2003-415517 filed on Dec. 12, 2003. The entire of contents of each of the above applications is incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/JP04/10585 | Jul 2004 | US |
Child | 11423270 | Jun 2006 | US |