Patent Description:
As is known, a digital filtering technique is the FIR filter ("Finite Impulse Response").

In the design of acoustic systems, specifications are described using frequency on a logarithmic scale (similar to the behavior of the human ear). FIR filtering shows significant limitations in terms of computational cost and algorithmic complexity in being able to operate in the low and medium-low frequency band (from <NUM> to <NUM>) requiring a very high number of delay taps (on the order of <NUM>,<NUM>).

To try to overcome such limitations of FIR filters, a filtering technique based on WFIR filters ("Warped Finite Impulse Response") has been proposed, which allows a non-uniform frequency resolution to be obtained, as instead occurs with classic FIR filtering.

The deformation of the frequency resolution (hence the name Warped) is achieved by replacing the delay element z-<NUM> in the FIR structure with a first-order Allpass filter, as proposed by <NPL>.

<FIG> shows a structure of a WFIR filter in direct form I. <FIG> shows an implementation for direct replacement z-<NUM> ⇔ D(z), which, however, also results in an increase in computational cost; <FIG> shows a more efficient structure, for example presented by <NPL>.

Such equivalent structure is able to save memory and operations and makes the overall balance favorable to WFIR, succeeding in achieving simultaneously the aims of precision in low frequency, sustainable computational cost and contained number of delay taps, making it particularly suitable for equalization applications of the audio signal reproduced through acoustic diffusers.

In some audio signal equalization applications, the possibility of processing the audio signals in real-time is required, i.e. to modify, through the use of a user interface, the parameters of the filters, characterizing their frequency response. <CIT> disclosed an audio equalization filter that can be generated by frequency warping one or more digital filters having a plurality of frequency bands.

The object of the present invention is to propose a method and a device to adjust the frequency response of a digital filter able to combine a high quality of filtering with an efficiency and a speed such as to allow an adjustment of the frequency response practically in real time, i.e. limiting as much as possible the delay between the modification of the filter parameters by the user and the result of the modification on the output signal.

Said object is achieved by a method of adjusting the frequency response of a digital filter according to claim <NUM> and by a digital signal processing device according to claim <NUM>.

The English term "taps" indicates the coefficients, or samples, of a digital filter.

According to claim <NUM>, a method is proposed for adjusting the frequency response of a digital filter by means of a digital signal processing device having a user interface, in particular for the processing of digital audio signals, comprising the steps of:.

In one embodiment, the step of calculating the taps of the digital filter takes place in real time during the definition of the desired curve and comprises a quick synthesis with a low number of taps during a modification of the desired curve, and a slow synthesis with a large number of taps in the absence of modification of the desired curve.

In one embodiment, a modification of the desired curve during the slow synthesis causes the interruption of the slow synthesis and the switch to the fast synthesis.

In one embodiment, the λ parameter of the WFIR filters for the delay lines is variable.

In one embodiment, the states of the Allpass filters are concatenated by means of a pipeline technique so as to obtain a number of taps equal to the sum of the concatenated blocks.

In one embodiment, the processed samples are concatenated so as to subdivide the band to be processed into sub-bands, to each of which a filtering with a different λ parameter may be applied, so as to maximize the resolution for the band of interest.

In one embodiment, the cascade of the Allpass filter may be expressed with the formula: <MAT>.

In one embodiment, the FIR filter applied to the state variables of the first-order Allpass filter cascade may be expressed with the formula: <MAT>
wherein
Xn indicates the sample at the input to the second-order nth parametric filter.

Xn-<NUM> indicates the previous sample of the second-order parametric filter, which corresponds to the output sample of the previous filter;.

Yn indicates the sample at the output from the second-order nth parametric filter.

Tap represents the tap for the application of the FIR filter.

In one embodiment, the FIR filtering operation on the states is carried out in parallel with the Allpass filtering operation.

Further object of the present invention is a device for processing digital signals, in particular audio signals, comprising hardware and software means suitable for implementing a method for adjusting the frequency response of a digital filter as described above.

In one embodiment, the device comprises:.

In one embodiment, the device comprises a manager module suitable for managing the inputs and outputs of shifting, storing, processing and multiplexing modules.

The features and advantages of the adjustment method and device according to the invention will, however, become evident from the description provided hereinafter of their preferred embodiments, provided to be indicative and non-limiting, with reference to the accompanying figures, wherein:.

<FIG> represents the general algorithm for adjusting the frequency response of a digital filter, which comprises a synthesis block <NUM> of the taps of the filter starting from a set <NUM> of frequency specifications of a desired curve describing the frequency response of the filter.

<FIG> shows an example of a graphical user interface for adjusting the frequency response. The user-designed curve that represents the variable trend of the frequency response of the filter as a function of the frequency is indicated with <NUM>.

For example, the curve <NUM> is defined, for each frequency sub-interval, by one or more parameters that define and characterize the desired curve.

Therefore, the proposed adjustment algorithm must calculate the filter taps, starting from the curve <NUM>, also known as the "target curve", drawn by the operator.

Such operation is defined, with reference to the general algorithm of <FIG>, "synthesis of the taps".

The operator has available various tools for defining the target curve <NUM>, from the use of the mouse, to the use of gestures via a touch pad. In another embodiment, parameters may be edited by writing the precise number, or by using sliders.

In one embodiment, each individual channel may be part of a group of signals to which the operator may apply a desired filtering. Thus, the synthesis step <NUM> of the taps is preceded by the synthesis of the transfer functions of all the channels contributing to the definition of the overall curve.

<FIG> is a graphic representation of the effect of the synthesis of the transfer functions of each channel belonging to the group represented.

According to one aspect of the invention, the synthesis step <NUM> of the taps is broken down into two distinct sub-steps <NUM>, <NUM> (type A synthesis, or first synthesis, and type B synthesis, or second synthesis) having as a result the taps of the overall filter (<FIG>).

The type A synthesis <NUM> is suitable for generating filters from a target curve 1A which specifies the amplitude of the transfer response of the filter as a function of the frequency.

These frequency specifications are used to generate an FIR using the windows technique (step <NUM>). The filter obtained is a sequence that has the characteristic of having a linear phase.

The sequence is subsequently returned to minimum phase by taking the real part of the cepstrum (step <NUM>).

As is known, the cepstrum is the inverse Fourier transform of the real part of the logarithm of the modulus of the Fourier transform of a sequence, and has the property of having the same modulus, but minimum phase with respect to the starting sequence.

Subsequently (step <NUM>), the sequence obtained is brought into the "warped" domain, through filtering by a WFIR filter with a warping factor -λ (note the opposite sign relative to the parameter used in real-time low-level filtering).

A window (e.g. with a Hamming filter) is then applied to the sequence after warping (step <NUM>), in order to have the best compromise between frequency resolution and the containment of the artifacts introduced by the truncation of the virtually infinite sequence to N taps.

The taps <NUM> of the WFIR A filter are thus obtained.

The type B synthesis <NUM> starts from a target curve 1B generated by a filter that replicates the effect of a cascade of second-order parametric filters (in technical jargon "biquad"), typical of audio applications.

The deformation of the frequency axis (step <NUM>) occurs by recalculation of the coefficients [a0 a1 a2] and [b0 b1 b2], typical of a second-order filter, in coefficients [aw0 aw1 aw2] and [bw0 bw1 bw2] obtained by replacing the delay element z-<NUM> with a first-order Allpass filter.

Thus, the impulse response of the second-order filter cascade system (step <NUM>) is generated and then truncated to obtain a finite sequence.

Subsequently, such truncated sequence is then windowed, for example by means of a Hamming filter (step <NUM>).

The taps <NUM> of the WFIR B filter are thus obtained.

The two sequences <NUM>, <NUM> obtained through the two synthesis procedures A and B are then convoluted (step <NUM>) to obtain the final sequence <NUM>, which will take into account all the specifications of the overall curve.

Note that the design of the frequency response, as well as the synthesis of the taps, must allow for speed and consistency.

"Speed" means that the operator must not feel a slowdown or pause while dragging the mouse or making a gesture.

From analyses performed, a fast command execution time means one that is performed in a maximum time of <NUM>.

The speed, however, must not compromise the consistency of the data (what the software shows on the screen must correspond to the processing performed by the device).

Therefore, in one embodiment, the sending of a command consists of two moments:.

The graphics are therefore updated only if the command has been executed correctly.

In this way, the consistency of data between software and processing may be assured.

The synthesis may be carried out by high-level software, as well as directly in the embedded environment.

However, to ensure consistency (the device, when restarted, must be able to perform the same filtering without the need to use high-level software), appropriate measures must be taken in case the synthesis is carried out at a high level.

The situation wherein the connection between software and devices is compromised is also managed.

In this scenario, it may happen that a command sent by the software may not be completed. To support such a scenario, there is device-level thread management, which, at predetermined time intervals, checks the consistency of the data.

The need to obtain a frequency response superimposable to the defined target (i.e. to minimize the error between the target and the result), is satisfied by appropriately calibrating the λ parameter and increasing the number of taps.

However, this would be at odds with the speed of synthesis of the taps, the required computational load of which increases in proportion to the number of taps.

The proposed method and adjustment device allow the criteria of speed, consistency and quality to be satisfied simultaneously.

Taking into consideration a database of pulses for different frequency curves, it has been analytically found that the first <NUM> taps already allow the frequency response to be defined with good approximation.

According to one aspect of the invention, an adaptive synthesis of the taps is used: a quick synthesis with a sufficient number of taps to characterize the frequency response in the transients (for example during movement of the mouse or while making a gesture), with a progressively slower synthesis, but with a greater number of taps, when the operator interrupts his/her intervention.

A new intervention of the operator, during the period of time wherein the high-quality synthesis is carried out, must interrupt the current synthesis in favor of speed.

Such objective is achieved by using a series of threads, one for each processing channel, which, upon receipt of a command, wait a certain time, for example fixed at <NUM> second, after which they start the qualitative synthesis.

In the event that a new command is received (thus the operator is intervening on the parameters of the filter), if the command is of the same channel for which the qualitative synthesis has been started, the thread is interrupted to favor the execution of the fast command, to then restart the qualitative synthesis procedure.

For example, one may hypothesize a synthesis made in less than <NUM> for the fast solution and a synthesis that may reach even <NUM> in the case of slow synthesis (time needed for the signal to become stable).

As for the practical execution of WFIR filters, in one embodiment, raised cosine filters are used, as well as classic filters (parametric, high pass, low pass, all pass and shelving), using high quality WFIR filters based on an FPGA architecture.

Such technique allows for minimum phase filtering and real-time processing to be obtained.

"Real-time" here means that after receiving samples of different channels, with clocks in the domain of audio signals (now <NUM>), the processed sample, net of a still contained latency (few clock pulses), even a single sample clock pulse, provides output samples of the different channels processed.

Considering a clock processing equal to <NUM>, this means that every <NUM> or so (<NUM>/<NUM> seconds) one obtains all the output channels processed relative to the input channels received during the previous sampling.

Also object of the present invention is a modular base block capable of processing <NUM> simultaneous channels, in a single sample, for <NUM> taps.

The choice of the parameters described below depends on the resources available at the FPGA level (thus there is a multidimensional modularity, both at the level of audio parameters and at the level of resources).

Such block may arbitrarily use floating-point data (float and double) as well as fixed-point data of different data widths as needed and depending on the resources available on the FPGA.

Moreover, such block does not impose a constant λ parameter for the delay lines, thus allowing WizFir (Warped Individual z Fir) filtering techniques to be implemented.

As shown in <FIG>, to achieve high quality, the modular base block may be linked in two ways:.

Concatenation of the states of the Allpass filters allows the number of taps to be increased, resulting in a number of taps equal to the sum of the concatenated blocks; for example, the number of taps is doubled in the case of concatenating two blocks with the same number of taps.

The concatenation of the processed samples allows the band to be processed to be subdivided into sub-bands, to each of which a filtering with a different λ parameter may be applied, so as to maximize the resolution for the band of interest.

According to one aspect of the invention, the modular base block uses multiplication and addition to perform the two main functions at the base of the filtering, namely the first-order Allpass filter and the FIR filter applied to the states of the first-order Allpass filter cascade.

In particular, the formula of the Allpass filter cascade is ascribable to: <MAT>.

The FIR filter, on the other hand, is applied to the state variables of the biquad cascade, i.e.: <MAT> where.

The two operations are set to have a latency time equal to the number of channels to be processed.

For example, the following results were obtained:.

The latency of each single block is calculated taking into account the characteristics of the FPGA, in order to avoid an exorbitant use of resources, as well as to avoid the onset of timing errors.

This allows one to obtain, net of an initial latency time equal to the number of channels to be processed, one processing result for each system clock pulse.

In one embodiment, the FIR filtering operation on the states may be carried out in parallel with the Allpass filtering operation (as it takes the taps and the Xn-<NUM> as input), reducing the overall latency time.

The total latency time is therefore equal to the number of taps, multiplied by the number of channels to be processed, with the addition of a latency time equal to the number of channels to be processed.

Considering, for example, a system clock equal to <NUM> and a sampling equal to <NUM>, <NUM> clock pulses are available, i.e.:
Available clock pulses = <NUM>/<NUM> = <NUM>.

In the hypothesis of <NUM> processing channels, a processing equal to <NUM> taps is obtained, insofar: <MAT>.

Note that the processing clock may have jitter and therefore a certain tolerance should be considered, as techniques to handle possible exceptions should be considered.

In an embodiment, for parameters with history, such as parameters Xn-<NUM> and Yn-<NUM>, shift registers are used (Shifting module <NUM> in <FIG>).

In one embodiment, for the storage of the taps, which may be modified in real-time, Block Ram (Storing module <NUM>) is used.

Storing also involves saving the states for the Allpass filter cascade.

A processing module <NUM> implements the Allpass and FIR filtering functions.

Since the results of the processing functions require feedback, the input of the same processing module passes through multiplexing functions <NUM> that allow the correct signal to be selected.

Claim 1:
Method for adjusting the frequency response of a digital filter by means of a digital signal processing device having a user interface, in particular for processing digital audio signals, comprising the steps of:
- defining a desired curve of the frequency response of the filter;
- calculating (<NUM>) the taps of the digital filter so as to obtain a frequency response that approaches said desired curve,
wherein the filter taps are obtained by a convolution (<NUM>) between the taps of a first WFIR filter (<NUM>) and the taps of a second WFIR filter (<NUM>), where the taps of the first WFIR filter are calculated through the steps of:
- starting from the amplitude of the desired curve as a function of the frequency, generating an FIR filter using the window method (<NUM>), so as to obtain a sequence having a linear phase;
- applying an inverse Fourier transform to the real part of the logarithm of the Fourier transform module of said linear phase sequence, so as to obtain a minimum phase sequence (<NUM>);
- applying a WFIR filter with a warping factor -λ (<NUM>) to said minimum phase sequence;
- applying a window function (<NUM>) to the filtered sequence,
and wherein the taps of the second WFIR filter are calculated through the steps of:
- starting from the desired curve, defining a cascade (1B) of second-order parametric filters;
- carrying out a deformation of the frequency axis (<NUM>) of said filter cascade, replacing each delay element, z-<NUM>, of said filter cascade with a first-order Allpass filter;
- calculating an FIR filter using an impulse response truncation method (<NUM>) for said filter cascade, so as to obtain a finite sequence;
- applying a window function (<NUM>) to said finite sequence.