CN107846205A - A kind of digital filter quickly designs and its program code automatic creation system - Google Patents
A kind of digital filter quickly designs and its program code automatic creation system Download PDFInfo
- Publication number
- CN107846205A CN107846205A CN201711024651.4A CN201711024651A CN107846205A CN 107846205 A CN107846205 A CN 107846205A CN 201711024651 A CN201711024651 A CN 201711024651A CN 107846205 A CN107846205 A CN 107846205A
- Authority
- CN
- China
- Prior art keywords
- digital filter
- filter
- design
- software
- digital
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03H—IMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
- H03H17/00—Networks using digital techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
- G06F8/315—Object-oriented languages
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/447—Target code generation
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03H—IMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
- H03H17/00—Networks using digital techniques
- H03H2017/0072—Theoretical filter design
- H03H2017/0081—Theoretical filter design of FIR filters
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03H—IMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
- H03H17/00—Networks using digital techniques
- H03H2017/0072—Theoretical filter design
- H03H2017/009—Theoretical filter design of IIR filters
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Complex Calculations (AREA)
Abstract
The invention discloses a kind of quick design of digital filter and its program code automatic creation system, it includes iir digital filter design software and digital filter assessment software;Described iir digital filter design software includes four independent iir digital filter design softwares, realizes Butterworth digital filter design, Chebyshev's I types digital filter design, Chebyshev's II types digital filter design, the design of elliptic numerical wave filter respectively.The present invention by different type, different intermediate zone width, different orders iir digital filter design and test, can be used the preferred filters solutions in family, easily filter out preferred plan in the various digital filters quickly generated by the inventive method.The system automatically generates the real time filter program code that can be run in ownership goal system.Ownership goal system is mostly using single-chip microcomputer, digital signal processor DSP as data collecting system, control system, communication system of core etc..
Description
Technical field
The present invention relates to a kind of quick design of digital filter and its program code automatic creation system.
Background technology
The design of digital filter is the core of digital information processing system.The design of digital filter widely uses at present
Plan and handbook, design process is cumbersome, and computational accuracy is not high, and design efficiency is low.At present using it is more be to pass through
MATLAB programming languages program designs and tested digital filter, and method is the one group of filtering provided using system
Device design function realizes the design of wave filter, even if so, designer is also more difficult quickly realisation using this programming language
The excellent digital filter design of energy index, designer not only need to write and debug filter design program, it is also necessary to write
Test the performance of designed wave filter with debugging filters to test program and assess the quality of wave filter.It is not easy to realize intuitively
And quickly design and test.It is not easy to directly generate the good numeral filter of the real-time that can directly run in ownership goal system
Ripple device program code.
At present, with the raising of the chip arithmetic speeds such as single-chip microcomputer, digital signal processor (DSP), digital filter
Application is more and more extensive.But because digital filter mathematical theory is abstract, design process is cumbersome, ordinary designer is more difficult solely
The vertical design and checking for completing digital filter.
The content of the invention
The technical problem to be solved in the present invention is the defects of overcoming prior art, there is provided a kind of digital filter quickly designs
And its program code automatic creation system, make filter designer on the premise of no more digital filter design knowledge,
Wave filter technology index as requested, which quickly designs iir digital filter and obtains the complete C programmer of wave filter, to be turned into
May.
In order to solve the above-mentioned technical problem, the invention provides following technical scheme:
The present invention provides a kind of digital filter quickly design and its program code automatic creation system, and it includes IIR numeral filters
Ripple device design software and digital filter assessment software;Described iir digital filter design software includes four independent IIR
Digital filter design software, realize respectively Butterworth digital filter design, Chebyshev's I types digital filter design,
Chebyshev's II types digital filter design and the design of elliptic numerical wave filter.
Further, above-mentioned digital filter design software can assess software with independent operating or by digital filter
Directly invoke, make the design and checking integration of digital filter.
Further, each digital filter design software is divided using the main interface of dialogue box form in main interface
For low pass, high pass, band logical, band four digital filter design panels of resistance, each panel that designs has input respective filter design
Data input frame, exponent number rounding select button, calculating exponent number button, calculating difference equation button, the difference equation of leafing through of index
Button.
Further, the whole difference equations and other wave filters ginseng of designed digital filter are checked on software interface
Number.The C language code of design result can be automatically copied to clipbook, be adhered directly onto for user in the engineering of oneself and realize number
Word filter function.Or paste digital filter assessment software and be filtered device test.
Further, described digital filter, which assesses software, includes window interface, and the window interface is provided with title
Column, menu bar, toolbar, status bar, workspace.
Further, described workspace is used to show multichannel time domain waveform and spectrogram corresponding with time domain waveform;It is more
Road time domain waveform per being the combined waveform according to caused by the setting of user all the way, combined waveform by various parameters sine
Ripple, square wave, triangular wave superposition composition, so as to the filter effect of the digital filter of real-time testing difference in functionality.
Further, the design result of digital filter is copied directly to performance of filter and assessed in software, passes through assessment
Built-in wave filter compiler directly generates digital filter program codes after compiling automatically in software, and each wave filter can lead to
Switch is crossed to open and close.
Further, directly observe combined waveform and pass through the filter effect after digital filter, automatic or manual measurement ripple
The cycle of shape, frequency, amplitude, peak-to-peak value;The real-time coefficient correlation of any two-way waveform can be calculated and be shown automatically.
Further, filter assessment software produces multichannel real-time waveform, and multiple digital filterings can be set to every road waveform
Device, each wave filter per road waveform can be opened or closed with serial or parallel connection, each wave filter by switch, each wave filter
The coefficient of difference equation can be checked and copied at any time.
Further, digital filter assesses the spectrogram of software real-time display time domain beamformer and waveform, in time domain and
Frequency domain comprehensively observes combined waveform by the filter effect after digital filter, and exports the complete C language of digital filter
Program frame, and clipbook is copied to, allow user that digital filter directly is realized into program pastes oneself
In engineering, compiling immediately passes through, and realizes digital filtering function.
The beneficial effect that is reached of the present invention is:
Invention avoids the work of the digital filter design of user.
Invention avoids the work that user writes digital filter program.User is without writing a line program code
Under the premise of, it can quickly obtain the digital filter program for meeting user's technical requirement, and can be conveniently by can be free group
The performance of the real-time waveform test filter of conjunction.User's choosing multiple scheme come design wave filter and assess filter quality, such as
Butterworth type, Chebyshev I types, Chebyshev II types, ellipse digital filter.By to different type, different transition
Bandwidth, different orders iir digital filter test, the preferred filters solutions in family can be used, easily pass through this various
Preferred plan is filtered out in the digital filter that inventive method quickly generates.And obtain can be run in ownership goal system immediately
Real time filter program code.Ownership goal system is mostly that the data using single-chip microcomputer, digital signal processor DSP as core are adopted
Collecting system, control system, communication system etc., these systems are most at present all to be developed using C language or C Plus Plus.
Brief description of the drawings
Accompanying drawing is used for providing a further understanding of the present invention, and a part for constitution instruction, the reality with the present invention
Apply example to be used to explain the present invention together, be not construed as limiting the invention.In the accompanying drawings:
Fig. 1 is the workflow diagram of the present invention.It is soft that simulation of Signal Processing experiment software therein can be used as digital filter to assess
Part.
Embodiment
The preferred embodiments of the present invention are illustrated below in conjunction with accompanying drawing, it will be appreciated that described herein preferred real
Apply example to be merely to illustrate and explain the present invention, be not intended to limit the present invention.
As shown in figure 1, a kind of digital filter quickly designs and its program code automatic creation system, it includes IIR numbers
Word filter-design software and digital filter assessment software.The embodiment of iir digital filter design software is:Design four
Individual independent iir digital filter design software, Butterworth digital filter design, Chebyshev I types numeral are realized respectively
Wave filter design, Chebyshev's II types digital filter design and the design of elliptic numerical wave filter.These digital filter designs
Software can independent operating, also can by digital filter assess software directly invoke, make digital filter design and checking one
Body.Each digital filter design software is divided into low pass, high pass, band using the main interface of dialogue box form in main interface
Logical, band four digital filter design panels of resistance, each panel that designs have the data input of input respective filter design objective
Frame, exponent number rounding select button (rounding up or down), calculate exponent number button, calculate difference equation button, difference side of leafing through
Journey button.Whole difference equations of designed digital filter and other filter parameters can be checked on software interface.It can incite somebody to action
The C language code of design result (coefficient of wave filter difference equation) is automatically copied to clipbook, is adhered directly onto certainly for user
Digital filter functions are realized in oneself engineering.Or paste digital filter assessment software and be filtered device test.
Digital filter assess software embodiment be:Software uses window interface, there is title bar, menu bar, instrument
Column, status bar, workspace.4 tunnel time domain waveforms and 4 spectrograms corresponding with time domain waveform can be shown in workspace.4 tunnel time domains
Waveform per being all the combined waveform according to caused by the setting of user all the way, combined waveform by the sine wave of various parameters, square wave,
Triangular wave (integrating to obtain by square wave) superposition forms.So as to the filter effect of the digital filter of real-time testing difference in functionality.Number
The design result (coefficient of wave filter difference equation) of word wave filter can be copied directly to performance of filter and assess in software, pass through
Assess after wave filter compiler built-in in software compiles automatically and directly generate digital filter program codes, each wave filter
It can be opened and closed by switching.Combined waveform can directly be observed by the filter effect after digital filter, can automatically or hand
The cycle of dynamic measured waveform, frequency, amplitude, peak-to-peak value, any two passage waveform that user selectes can be calculated and be shown automatically
Real-time coefficient correlation.Filter assessment software can produce Multichannel Waveform (the present embodiment is 4 tunnels), can be set per road waveform multiple
Digital filter (the present embodiment is 4 digital filters), can be with serial or parallel connection, each wave filter per the wave filter of road waveform
It can be opened or closed by switch, the coefficient of each wave filter difference equation can be checked and copied at any time.This digital filter is commented
Estimate software can real-time display time domain beamformer and waveform spectrogram, can comprehensively observe combined waveform in time domain and frequency domain and pass through
Filter effect after digital filter, the amplitude versus frequency characte of digital filter can be directly observed by swept-frequency signal.Digital filter
The complete C programmer framework of the exportable digital filter of software is assessed, and is copied to clipbook, allows user direct
Digital filter is realized that program is pasted in the engineering of oneself, compiling immediately passes through, and realizes digital filter functions.
The complete design process of infinite-duration impulse response (IIR) digital filter is encapsulated in one group of design software by the present invention
In.This group of design software be respectively intended to realize Butterworth digital filter design, Chebyshev's I types digital filter design,
Chebyshev's II types digital filter design, the design of elliptic numerical wave filter.Digital filtering is given the checking work of wave filter
Device Performance Evaluation software.The complete C programmer of C programmer and digital filter of digital filter design result is soft by this
Part automatically generates, and is not required to user oneself and writes and debug Real Time Digital Filter program code.Improve ownership goal system development
Efficiency, and improve product quality.
The present invention utilizes digital filter design software, and the design objective of wave filter need to only be filled in software interface by user
Data input frame in.Design objective includes:Sample frequency, passband maximum attenuation amount, minimum attenuation in stop band amount.For low pass filtered
Ripple device, in addition to cut-off frequecy of passband and stopband initial frequency.For high-pass filter, in addition to stopband cut-off frequency and passband
Initial frequency.For on bandpass filter, in addition to lower stopband upper limiting frequency, passband lower frequency limit, reference center frequency, passband
Limit frequency, upper stopband lower frequency limit.For bandstop filter, in addition to lower upper cut-off frequency frequency, stopband lower frequency limit, with reference in
Frequency of heart, stopband upper limiting frequency, upper passband lower frequency limit.After the completion of design objective is filled in, user can be by design software interface
" calculating exponent number " button calculate the exponent number of digital filter automatically, downward rounding or upward rounding may be selected in exponent number.User can
Press " calculating difference equation " button in design software interface and start wave filter Automated Design process, and output filter design knot
Fruit, the design result of digital filter are provided in the form of tandem type difference equation, are shown on software interface, and design is tied
Design result is directly pasted in the engineering of oneself to clipbook, realizes numeral by the coefficient copying of fruit difference equation for user
Filter function.Theory and practice proves that tandem type higher order digital filter can obtain good filter effect, and can make filtering
Device software programming standardizes.
The design of iir digital filter of the present invention make use of the design method of analog filter, and design simulation first filters
The transfer function of device, then the transfer function of analog filter is converted to by Bilinear transformation method the transfer letter of digital filter
Number.Specific design process is:
(1) angular frequency (circular frequency) of data signal is calculated according to design objective.
The design objective of digital filter is sample frequency, passband edge frequency, stopband edge frequency, passband maximum attenuation
Amount, minimum attenuation in stop band amount.The essence of its Frequency Index is analog frequency.According to sampling thheorem, each edge frequency not above
The half of sample frequency.The first step of design is that these Frequency Index are converted to the angular frequency i.e. circumference frequency of digital filter
Rate is, it is specified that sample frequencyThe corresponding π of circular frequency 2, if f is the frequency of analog signal,For the angular frequency of analog signal,Angular frequency for corresponding data signal is circular frequency.Then.If the sampling period is,, formula can be usedIt is data signal by the frequency conversion of analog signal
Angular frequency is circular frequency.Obviously, circular frequency corresponding to each edge frequency is 0 -- between π.
(2) angular frequency of digital filter is converted to the angular frequency of analog filter.
This step is related to numeric field z-plane to the mapping problems of analog domain s planes.To prevent frequency aliasing phenomenon, protect
The stopband attenuation for demonstrate,proving the digital filter of design reaches the requirement of design objective, should use Bilinear transformation method design digital filtering
Device.Bilinear transformation method make use of the non-linear behavior of tan, and non-linear compression method is employed to frequency axis.Its z-plane
Mapping relations to s planes are nonlinear.When the data signal angular frequency of z-planeWhen changing to π by 0, the simulation of s planes
Signal angular frequencyChanged to by 0, when the data signal angular frequency of z-planeWhen changing to-π by 0, the simulation letter of s planes
Bugle frequencyChanged to by 0.Therefore it by the analog frequency axles of whole s planes (Axle) it has been compressed to z-plane list
On one week of circle of position, i.e., from s planesArrive- the π for being compressed to z-plane arrives+π.Analog frequency and numerical frequency one
One correspondence, be not in frequency aliasing phenomenon.For the digital filter using Bilinear transformation method design, z-plane to s planes
Mapping relations be, the angular frequency of analog filterWith the angular frequency of digital filterMapping relations
For.We can be converted to each edge frequency by this formula the angular frequency of analog filter(subscript
I is the sequence number of edge frequency, typically with different lowercase letters).
(3) normalized radian frequency is calculated.
The angular frequency of analog filter is normalized this step.And by analog high-pass, band logical, bandstop filter normalizing
Change the normalized radian frequency that angular frequency is transformed to simulation low-pass filter, to utilize the design of ripe simulation low-pass filter
Method designs high pass, band logical, bandstop filter.
(a) low pass filter:
Two edge frequency (cut-off frequecy of passband of simulation low-pass filterWith stopband initial frequency,)
WithIt is normalized.If the normalized radian frequency of simulation low-pass filter is, normalizing complex variable is,
Then have, here,。
Normalize cut-off frequecy of passband
Normalize stopband initial frequency
(b) high-pass filter:
Two edge frequency (stopband cut-off frequencies of mimic high pass filterWith passband initial frequency,)
WithIt is normalized.If the normalized radian frequency of mimic high pass filter is, normalizing complex variable is,
Then, orderThe main frequency point of high-pass filter can be converted to the main frequency point of low pass filter.
By, have
Normalize stopband cut-off frequency
Normalize passband initial frequency
(c) bandpass filter:
If the passband lower limit angular frequency of analog bandpass filter is, upper cut-off frequency angular frequency be, lower stopband upper limit angle
Frequency is, upper stopband lower limit angular frequency be.Pass band width, bandpass center angular frequency,.Have。
With pass band widthIt is reference frequency to each frequency valuesIt is normalized.
Order, then,
,,,
,
If the normalized radian frequency of simulation low-pass filter is, normalizing complex variable is, then。
Set again the normalized radian frequency of analog bandpass filter as, normalizing complex variable is, then.According to analog bandpass filterAxle and simulation low-pass filterThe corresponding relation of each Frequency point of axle has.Because,, so having,。
By
,,
Take absolute value the absolute value conduct of smaller。
(d) bandstop filter:
If the stopband lower limit angular frequency of simulation bandstop filter is, stopband upper limit angular frequency be, lower upper cut-off frequency angle
Frequency is, upper passband lower limit angular frequency be.Bandwidth of rejection, stopband center frequency,.Have。
With bandwidth of rejectionIt is reference frequency to each frequency valuesIt is normalized.
Order, then
,,,
,
If the normalized radian frequency of simulation low-pass filter is, normalizing complex variable is, then。
Set again simulation bandstop filter normalized radian frequency as, normalizing complex variable is, then.According to simulation bandstop filterAxle and simulation low-pass filterThe corresponding relation of each Frequency point of axle has.Because,, so having,。
By
,,
Take absolute value the absolute value conduct of smaller。
(4) exponent number of wave filter is calculated.
According to the normalization width square characteristic of wave filter
And attenuation function
The exponent number n of wave filter can be obtained.
Here, different iir filters has different width square characteristics.
In the formula of normalization width square characteristic,For coefficient of variation,For n characteristic function, with wave filter
Type and it is different.
(a) all it is smooth in passband and stopband for Butterworth filter, its amplitude versus frequency characte.
Therefore, C takes constant 1.。
(b) for Chebyshev's I mode filters, its amplitude versus frequency characte, in ripple fluctuation is waited, is in smoothly to decline in stopband in passband
Subtract.Therefore,For passband ripple coefficient..Here,It is that n rank Chebyshevs are multinomial
Formula.
(c) for Chebyshev's II mode filters, its amplitude versus frequency characte, in smooth decay, is in wait ripple in stopband in passband
Fluctuation, therefore,For stopband ripple factor.
(d) for elliptic filter, its amplitude versus frequency characte in passband and stopband all in waiting ripple to fluctuate, therefore,
For passband ripple coefficient, and stopband ripple factor byWith the frequency selectivity factorTogether decide on.
.Here,It is Elliptic Rational function.
The normalization width square characteristic of Butterworth filter is
If make the passband maximum attenuation amount of Butterworth filter, then。
The normalization width square characteristic of Chebyshev's I mode filters is
The normalization width square characteristic of Chebyshev's II mode filters is
The normalization width square characteristic of elliptic filter is
It is n rank Chebyshev polynomials, can be write as。
It is Elliptic Rational function.It should be noted that Elliptic Rational functionIt is normalization angular frequency
RateFunction, rather than the frequency selectivity factorFunction, the frequency selectivity factorConstant can be regarded as.Here, have
Reason function refers to that independent variable isThe ratio between two polynomials of degree n
If passband maximum attenuation amount is(dB), minimum attenuation in stop band amount is(dB), can be exported by calculating various
The exponent number calculation formula of iir filter.
(a) for Butterworth filter,
(b) for Chebyshev's I mode filters,
(c) for Chebyshev's II mode filters,
(d) for elliptic filter,
Wherein
,
The frequency selectivity factor
More than it is various in,, coefficient of variation is referred to as in elliptic filter.
The passband fluctuation coefficient that Chebyshev I mode filters and elliptic filter can be calculated is
The stop band ripple coefficient of Chebyshev's II mode filters is
The stop band ripple coefficient of elliptic filter is
, whereinIt is coefficient of variation.
The filter order n calculated by above formula is typically decimal, it is necessary to which rounding is integer.Have upward rounding and
Downward rounding two schemes, generally, in order to ensure the realization of wave filter design objective, should be orientated rounding.But for filtering
The less high occasion of the performance requirement of device, in order to improve the arithmetic speed of goal systems, lower rounding can also be orientated.
(5) the transfer function G (s) of calculating simulation wave filter.
If design is high pass, band logical or bandstop filter, it is necessary first to carries out frequency transformation, is converted into equivalence
Low pass filter, so as to make full use of maturation simulation low-pass filter design method.IfFor simulation low-pass filter
Normalized radian frequency, p be simulation low-pass filter normalization complex variable.
(a) for low pass filter:
Due to
The then transfer function of low pass filter
(b) for high-pass filter:
ByAnd ,
Therefore,.Because the amplitude versus frequency characte of wave filter is all the even function of frequency, therefore negative sign can be gone
Fall, have。
The then transfer function of high-pass filter
(c) for bandpass filter:
ByAnd
。
By,。
,。
Then
The then transfer function of bandpass filter
(d) for bandstop filter:
ByAnd
。
Because the amplitude versus frequency characte of wave filter is all the even function of frequency, therefore negative sign can be removed, had
By,。
,。
Then
The then transfer function of bandstop filter
Seek simulation low-pass filterMethod it is different because of different types of wave filter.
For Butterworth filter, Chebyshev I mode filters, Chebyshev II mode filters, elliptic filter, root
According to its width square characteristic can limit of the derived distributions in s planes, for Chebyshev II mode filters and elliptic filter also
It is distributed the zero point in the imaginary axis.In order to ensure designed filter stability, the limit of s plane Left half-planes should be assigned to G
(p).For higher order filter, Ying JiangSplit into cascade (product) form of single order and second order filter.Positioned at negative real axis
On single limit corresponded to a first-order system, a pair of conjugate poles for being distributed in s plane Left half-planes have corresponded to one two
Level is united.Because the p and s of bandpass filter and bandstop filter are quadratic relations, therefore the transfer function G of its analog filter
(s) order will double.
All types of single orders, second order, the form of quadravalence analog filter transfer function are summarized:
For Butterworth and Chebyshev I mode filters (only limit, without zero point):
Low pass:
High pass:
Band logical:
Band resistance:
For Chebyshev II types and elliptic filter (there is pole and zero):
Low pass:
High pass:
Band logical:
Band resistance:
More than it is various in, coefficient a, b, c, d, e, f, g are constant, can be calculated according to known conditions and p to s transformational relation
Obtain.
(6) the transfer function H (z) of digital filter is calculated with Bilinear transformation method.
Conversion from analog filter to digital filter uses Bilinear transformation method,
Order, then
The z domains transfer function of first-order system, second-order system and fourth-order system can be exported.
For first-order system:
For second-order system:
For fourth-order system:
Wherein coefficientWith (M is the exponent number of the filter-divider of cascade, take 1 respectively, 2,4) can pass through
Equation conversion directly exports.If the integer exponent number of wave filter is N, for even-order low pass and high-pass filter, system is by N/2
Second order filter cascade composition.For odd-order low pass and high-pass filter, system is by a firstorder filter and (N-1)/2
Second order filter cascade composition.For even-order band logical and bandstop filter, system is made up of N/2 four-step filter cascade.
For odd-order band logical and bandstop filter, system is made up of a second order filter and the cascade of (N-1)/2 four-step filter.
(7) difference equation corresponding with H (z) is calculated.
By transfer function and the corresponding relation of difference equation, corresponding difference can directly be write out according to transfer function H (z)
Divide equation.Such as
Firstorder filter
Difference equation is
Second order filter
Difference equation is
Four-step filter
Difference equation is
(a) for low pass and high-pass filter:
For even-order higher order filter, system difference equation is the cascade of N/2 second order filter.Filtered for odd-order high-order
Ripple device, system difference equation are the cascades of a firstorder filter and (N-1)/2 second order filter.
(b) for band logical and bandstop filter:
For even-order higher order filter, system difference equation is the cascade of N/2 four-step filter.Filtered for odd-order high-order
Ripple device, system difference equation are the cascades of a second order filter and (N-1)/2 four-step filter.
Above N is the integer exponent number of wave filter.
(8) Real Time Digital Filter program is write according to difference equation
Variable-definition:
Defining wave filter difference equation coefficient array, (two-dimentional floating number array, the first dimension are the numbers of cascading filter, and second ties up
It is the coefficient of cascaded differential equation, when realizing four-step filter, the coefficient of difference equation is F0-- F8, totally 9 coefficients, therefore
9) maximum length of second dimension is.
Define filter gain variable (floating number).
(two two-dimentional floating number arrays, the first dimension is cascading filter for definition filtering input rank and filtering output queue
Number, the second dimension is filtering input or filtering output data, input rank and output queue during due to realizing four-step filter
Respectively need to preserve 5 data, therefore 5) length of the second dimension can not be less than.The two queues are all circle queues, are worked as preserving
The filtering input data and filtering output data in preceding and preceding several sampling periods.
Define the number (integer, i.e., the length of the first dimension) of cascading filter.
The length and the front pointer (integer) of the second dimension that two queues second of definition input and output are tieed up.Due to input
Queue and the equal length of output queue, the two queues can share a front pointer.Queue length can not be less than 5, and this is
Due to that will have 9 coefficients when running four-step filter, input and output queue need to use the data in preceding 4 sampling periods, add
Upper current sample period totally 5 data.
Initialization function:
With wave filter design result (coefficient of difference equation) initialization wave filter difference equation coefficient array (two-dimensional array).
The filter gain exported according to wave filter design result initializes filter gain variable.
Initialize the individual number variable of cascading filter.
The number that initialization input and output queue two dimensional extent is equal to difference equation coefficient adds 1 again divided by 2, i.e. maximum
It is worth for 5.
It is 0. to initialize queue front pointer
The whole elements for initializing input and output queue are 0.
Initialization function need to only call once when program is run and started.
Real-Time Filtering function:
Queue position's variable array is defined, is respectively directed to the current location (position that front pointer points to of input and output queue
Put), the previous position of current location (the previous position that front pointer points to), the first two position (head of the queue of current location
The first two position that pointer points to) ....
The sampled value at current time is stored in the current location (position that front pointer points to) of input rank.With input team
(location variable array refers to the data stored in the data (each position that location variable array is pointed to) and output queue that are stored in row
To each position) according to the corresponding relation of difference equation be multiplied by the coefficient of correspondence in wave filter difference equation coefficient array respectively,
And make it is cumulative and.The position that this cumulative and writing filtering output queue front pointer is pointed to.Then front pointer is added
1, if plus 1 after front pointer be equal to the length of queue if put front pointer as 0.Using it is above-mentioned cumulative and divided by gain after as letter
Several return values return to caller.The return value of function is exactly the filtering output data at current time.For cascading filter,
The input that the output of previous wave filter should be used as to the latter wave filter by cyclic program performs filtering successively, then most
The output of the latter wave filter is exactly total output, will return to caller after this output divided by gain.Real-Time Filtering function
Called once per the sampling period.
The digital filter Performance Evaluation software of the present invention can produce multichannel combined waveform according to the setting of user, wherein often
Combined waveform can be shaken by multiple different frequencies, various amplitude, the sine wave of different initial phases and multiple different frequencies, difference all the way
Width, different initial phases, the square wave of different duty are formed by stacking.Direct current biasing can be added to these combined waveforms, can be carried out
Rectification, paraphase, differential, integration, amplification.Software produces these combined in real time waveforms by timer and waveform arithmetic unit.Utilize
These combined waveforms can easily test filter performance.Design result (the wave filter difference side of filter-design software
The coefficient of journey) can direct copying enter in digital filter Performance Evaluation software interface, pass through the wave filter compiler built in software
Real time filter target program is immediately generated after carrying out compiled online, the performance test of device can be filtered using combined waveform.
User is set easily to filter out most suitable digital filter.System is in by the oscillogram of time domain and the spectrogram of frequency domain
Existing waveform can intuitively assess filtering by the change before and after wave filter, user according to the change of time domain and frequency-domain waveform
The filter effect of device, and can the easily cycle and frequency of measured waveform, amplitude and peak-to-peak value, can calculate automatically and in real time
Show the coefficient correlation of any delay interval of any two-way waveform of user's selection.In addition, digital filter performance is commented
The low frequency signal that estimating software can carry out commonly using in communication system is conciliate to the Modulation and Amplitude Modulation of carrier signal and demodulation, frequency modulation(PFM)
The experiment of the frequency spectrum shifts such as tune, phase-modulation and demodulation, carry out communication system signal experiment for user and provide platform.Digital filtering
Device Performance Evaluation software, which has, to be prepared, runs, suspending three states.To multiple numeral filters can be set simultaneously per combined waveform all the way
Ripple device, each digital filter can be opened and closed with independent switch, may be configured as connecting per multiple wave filters of road waveform
It is or in parallel.The sample frequency of time domain waveform, walking speed, gain can be set.Spectrogram Fourier transformation points, display frequency scope can
Set.The coefficient and parameter of operating each wave filter can be checked and copied at any time.Digital filter Performance Evaluation software can be straight
Connect and call Butterworth digital filter design software, Chebyshev's I types digital filter design software, Chebyshev's II type numbers
Word filter-design software, elliptic numerical filter-design software, power function curve fitting software.Here, power function curve is intended
The work such as user data acquisition system nonlinear transducer calibration can be completed by closing software.The seat of known point on user's input curve
Mark, software can fit the power function curve equation of these points, and can be by the C language code copies of curve calculation procedure to cutting
Pasting board, use is directly pasted for user.
The design, test, program code that the present invention integrates digital filter automatically generate, and drastically increase user
The development efficiency of software, software quality is lifted, shorten the construction cycle, reduce development cost.Make user at data acquisition, signal
Manage and obtain substantial improvements with the software development process for analyzing, communicating, the field such as automatically controlling, product quality obtains substance and carried
It is high.
The present invention is applied to digital processing field.Realize the quick of infinite-duration impulse response (IIR) digital filter
Design, quick real-time simulation experiment, realize real-time iir digital filter C programmer Code automatic build.It is of the invention main
Applied to professional domains such as electronic information, control engineering, communication engineering, biomedical engineerings.
Present invention mainly solves the quick careful design of High-step IIR Digital Wave Filter and real-time simulation test problem.Using
Same method is also applied for the design and emulation of Finite Impulse Response filter.
The present invention is according to the difference equation of wave filter design result, the C programmer of fast automatic generation real time filter
Code, it can be directly embedded into user engineering and be used by a user, save the development time of user to greatest extent.
The present invention integrate design and test, by can independent assortment the direct test filter of real-time waveform filtering
Effect, the performance of visual assessment wave filter.
The present invention makes the designer of digital filter be freed from numerous and diverse mathematical computations, and quick obtain meets performance
The digital filter of index request.
The present invention makes filter software tester be freed from heavy filters to test work, makes them not have to set
Substantial amounts of test case is counted, by the performance of various combined waveform visual test wave filters caused by this filter assessment software,
The efficiency of test job is increased substantially, reduces exploitation test period, saves development cost.
Finally it should be noted that:The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention,
Although the present invention is described in detail with reference to the foregoing embodiments, for those skilled in the art, it still may be used
To be modified to the technical scheme described in foregoing embodiments, or equivalent substitution is carried out to which part technical characteristic.
Within the spirit and principles of the invention, any modification, equivalent substitution and improvements made etc., it should be included in the present invention's
Within protection domain.
Claims (10)
1. a kind of digital filter quickly designs and its program code automatic creation system, it is characterised in that is filtered including IIR numerals
Ripple device design software and digital filter assessment software;Described iir digital filter design software includes four independent IIR
Digital filter design software, realize respectively Butterworth digital filter design, Chebyshev's I types digital filter design,
Chebyshev's II types digital filter design and the design of elliptic numerical wave filter.
Quickly 2. design and its program code automatic creation system, its feature exist digital filter according to claim 1
In above-mentioned digital filter design software can directly invoke with independent operating or by digital filter assessment software, make number
The design and checking integration of word wave filter.
Quickly 3. design and its program code automatic creation system, its feature exist digital filter according to claim 1
In each digital filter design software using the main interface of dialogue box form, is divided into low pass, high pass, band in main interface
Logical, band four digital filter design panels of resistance, each panel that designs have the data input of input respective filter design objective
Frame, exponent number rounding select button, calculate exponent number button, calculate difference equation button, difference equation button of leafing through.
Quickly 4. design and its program code automatic creation system, its feature exist digital filter according to claim 3
In checking whole difference equations of designed digital filter and other filter parameters on software interface;System is given birth to automatically
Into can in ownership goal system real time execution digital filter C programmer code;Can be by the C language code of design result
Clipbook is automatically copied to, is adhered directly onto for user in the engineering of oneself and realizes digital filter functions;Or paste numeral
Filter assessment software is filtered device test.
Quickly 5. design and its program code automatic creation system, its feature exist digital filter according to claim 1
In described digital filter, which assesses software, includes window interface, and the window interface is provided with title bar, menu bar, instrument
Column, status bar, workspace.
Quickly 6. design and its program code automatic creation system, its feature exist digital filter according to claim 5
In for showing multichannel time domain waveform and spectrogram corresponding with time domain waveform in described workspace;Multichannel time domain waveform
Per being the combined waveform according to caused by the setting of user all the way, combined waveform by various parameters sine wave, square wave, triangular wave
Superposition composition, so as to the filter effect of the digital filter of real-time testing difference in functionality.
Quickly 7. design and its program code automatic creation system, its feature exist digital filter according to claim 6
In the design result of digital filter is copied directly to performance of filter and assessed in software, by assessing filter built-in in software
Ripple device compiler directly generates digital filter program codes after compiling automatically, each wave filter, which can pass through to switch, to be opened and close
Close.
Quickly 8. design and its program code automatic creation system, its feature exist digital filter according to claim 7
In, directly observe combined waveform by the filter effect after digital filter, cycle of automatic or manual measured waveform, frequency,
Amplitude, peak-to-peak value;The real-time coefficient correlation for any two passage waveform that user selectes can be calculated and be shown automatically.
Quickly 9. design and its program code automatic creation system, its feature exist digital filter according to claim 8
In filter assessment software produces Multichannel Waveform, and multiple digital filters can be set to every road waveform, per each filtering of road waveform
Device can be with serial or parallel connection, and each wave filter can be opened or closed by switch, and the coefficient of each wave filter difference equation can be with
When check and copy.
Quickly 10. design and its program code automatic creation system, its feature exist digital filter according to claim 9
In digital filter assesses the spectrogram of software real-time display time domain beamformer and waveform, is comprehensively observed in time domain and frequency domain
Combined waveform exports the complete C programmer framework of digital filter by the filter effect after digital filter, and by its
Copy to clipboard, allow user that digital filter directly is realized into program is pasted in the engineering of oneself, compile immediately
By realizing digital filtering function.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711024651.4A CN107846205A (en) | 2017-10-27 | 2017-10-27 | A kind of digital filter quickly designs and its program code automatic creation system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711024651.4A CN107846205A (en) | 2017-10-27 | 2017-10-27 | A kind of digital filter quickly designs and its program code automatic creation system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107846205A true CN107846205A (en) | 2018-03-27 |
Family
ID=61680697
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711024651.4A Pending CN107846205A (en) | 2017-10-27 | 2017-10-27 | A kind of digital filter quickly designs and its program code automatic creation system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107846205A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109157212A (en) * | 2018-08-30 | 2019-01-08 | 武汉吉星医疗科技有限公司 | The compound filter computing system and its method of electrocardiograph based on android system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103810321A (en) * | 2012-11-09 | 2014-05-21 | 美国亚德诺半导体公司 | Filterdesign tool |
CN104699881A (en) * | 2013-12-10 | 2015-06-10 | 中国航空工业第六一八研究所 | Design method of IMU digital filter for inertial navigation system |
CN105306010A (en) * | 2015-11-10 | 2016-02-03 | 西安交通大学 | Design method for convex combination self-adapting filter based on minimum error entropy |
CN106911144A (en) * | 2015-12-23 | 2017-06-30 | 中国科学院沈阳自动化研究所 | Photovoltaic inverter control system and method based on modelling exploitation |
-
2017
- 2017-10-27 CN CN201711024651.4A patent/CN107846205A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103810321A (en) * | 2012-11-09 | 2014-05-21 | 美国亚德诺半导体公司 | Filterdesign tool |
CN104699881A (en) * | 2013-12-10 | 2015-06-10 | 中国航空工业第六一八研究所 | Design method of IMU digital filter for inertial navigation system |
CN105306010A (en) * | 2015-11-10 | 2016-02-03 | 西安交通大学 | Design method for convex combination self-adapting filter based on minimum error entropy |
CN106911144A (en) * | 2015-12-23 | 2017-06-30 | 中国科学院沈阳自动化研究所 | Photovoltaic inverter control system and method based on modelling exploitation |
Non-Patent Citations (3)
Title |
---|
凌生强: "基于MATLAB与CCS的FIR滤波器的C语言实现", 《信息技术》 * |
施琴红: "基于MATLAB/FDATOOL工具箱的IIR数字滤波器的设计及仿真", 《科技广场》 * |
王冰: "基于STM32和FPGA的多通道多功能数据采集器", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109157212A (en) * | 2018-08-30 | 2019-01-08 | 武汉吉星医疗科技有限公司 | The compound filter computing system and its method of electrocardiograph based on android system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Iacobucci et al. | A frequency selective filter for short-length time series | |
Bennia et al. | An optimization technique for iterative frequency-domain deconvolution | |
CN101860344A (en) | Construction method of frequency-selecting filter and construction method for realizing FIR-type and IIR-type filters by adopting same | |
CN201298058Y (en) | High integration density programmed filter analysis device based on field programmable gate array (FPGA) | |
Yakimov et al. | Firmware of the amplitude spectrum evaluating system for multicomponent processes | |
CN107846205A (en) | A kind of digital filter quickly designs and its program code automatic creation system | |
CN104483619A (en) | Frequency characteristic testing system based on virtual instrument | |
WO2015012961A1 (en) | Extending programmable measurement device functionality | |
CN105892988B (en) | A kind of computing circuit based on FPGA, oscillograph and measuring instrument | |
Wetula | A Hilbert transform based algorithm for detection of a complex envelope of a power grid signals-an implementation | |
Piedra et al. | Digital Signal Processing comes of age | |
CN115238519A (en) | Research and development system for digital signal processing algorithm | |
McPherron | Predicting the Ap index from past behavior and solar wind velocity | |
Popa | ECG Signal Filtering in FPGA | |
CN106022222A (en) | Multiple-harmonic vibration signal decomposition apparatus and method | |
CN106501582A (en) | Signal base line processing method and signal base line processing equipment | |
JPS59211896A (en) | Detector responce abnormality diagnosing device | |
De Pra et al. | Development of real-time audio applications using Python | |
Kaminsky et al. | Virtual instrumentation based power quality analyzer | |
Wührl | Pilot Signal Removal, Digital Signal Processing Algorithm and it’s Practical Implementation | |
CN110459276A (en) | A kind of data processing method and relevant device | |
CN205829594U (en) | A kind of composite filter | |
Kumari | Easy-filter: A Design, Verification, and Validation Tool for Finite Impulse Response (FIR) Filter | |
Dondapati | DESIGN AND IMPLEMENTATION OF EFFICIENT DIGITAL FILTERS USING LABVIEW | |
Tobin | Difference Equations and the z-Transform |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180327 |