The invention relates to a methods and systems for filtering and characterising input signals using filters comprising or derived from Prism filters.
A Prism filter is a filter type that combines the benefits of Finite Impulse Response (FIR) filters and Infinite Impulse Response (IIR) filters. Prism filters are discussed in US2019294649A1 (herein referred to as reference [A]) and WO2019211309A1 (herein referred to as reference [B]). Both of these documents are incorporated herein by reference in their entirety.
The prior art Prism [A, 1] and ultra-narrowband Prism filter [B, 2, 3] provide a number of advantages over conventional convolution-based Finite Impulse Response (FIR) filtering. These advantages may include significantly reduced computational cost for both the initial filter design and for subsequent filter operation, for example in terms of the number of floating point operations required to update the filter output on receipt of a new input. However, these structures do have limitations. One limitation of the filter structure described in [B, 2] is that the stop band attenuation may be no lower than approximately −80 dB. A further limitation is that for long filters, for example exceeding 1 billion samples [2], the memory storage requirements may be large. A yet further limitation is that, although the design cost of an individual filter of the type described in [B, 2] may be low, in applications where large numbers of different filter designs are required, for example in spectral analysis of fixed data sets [3], the total filter design cost may remain high. An additional limitation, common to many filtering systems and well understood by those familiar with the art, is the tradeoff between filtering performance (for example the extent to which unwanted signal components are removed by the filter) and dynamic response (for example the time delay occurring between a change in the filter input and the corresponding change in the filter output). For FIR filters such as the Prism, it is well understood by practitioners of the art that the dynamic response is determined by the length of the filter in samples—the filtered response to a change in a characteristic of the input signal is complete once data with the new characteristic has passed through the entire length of the filter. Accordingly, as shorter filters have a faster dynamic response, it is desirable to find means of maintaining or improving filtering performance while maintaining or reducing filter length.
Ref [4] describes an alternative Prism filter structure, which may be described as ‘low pass’, contrasting with the ‘band pass’ design of [B, 2]. This filter structure consists of a series of layers or sets, where each layer contains three Prisms, and where a weighted sum of the outputs of the individual Prisms in each layer is calculated and used as the input to the next layer. As discussed further below, in the prior-art design, the outputs of the Prisms in each layer or set are all in phase. The weights are selected to provide a desired filter characteristic, for example maximizing the attenuation of the stop band. In reference [4], for example, a six layer filter is described which provides stopband attenuation of −138 dB. For this type of filter structure, the range of frequencies lying in the passband (i.e. those frequencies which are assigned a high gain by the filter) is fixed by the selected set of weights. Typically the pass band will lie between 0 Hz and the characteristic frequency m Hz, and hence the designation of the filter structure as ‘low pass’. However, as further explained in [4] and below, the technique of heterodyning, well-known to practitioners of the art, may be used in combination with a low pass filter to adjust the pass band frequency range. This low pass filtering structure may therefore be used to address several of the limitations of the band pass filter structure taught in the prior art [B, 2], as follows. Firstly, a single filter design, combined with the technique of heterodyning, can be used as a substitute for instantiating a series of distinct band pass filter designs, for example in spectral analysis (as described in [3]), thus reducing filter design cost. Secondly, a wider range of filter characteristics can be incorporated into a layered filter structure compared with the fixed characteristic of the band pass filter in [B, 2]: for example, higher stopband attenuation can be achieved. Thirdly, by applying Prisms in parallel, improved filter design may be possible while maintaining the overall filter length.
The techniques outlined above, which form the prior art, retain a number of limitations, including the tradeoff between filtering performance and dynamic response, and the memory requirements for large filters. It is an object of this invention to improve one or more such limitations.
This disclosure presents new Prism low pass filter structures, which may provide an improved tradeoff between filtering performance and dynamic response. These new filter structures may further provide greater design flexibility, enabling, for example, the ability to create a filter with a desirable degree of passband flatness and/or of stopband attenutation. The disclosure further presents techniques employing multiple Prism low pass filters, which may provide improved tradeoff between filtering performance and dynamic response. As large numbers of Prisms may be used in such layered filter structures, the relative computational advantage over the conventional convolutional calculation form of FIR filter may be reduced. Accordingly, this disclosure further describes methods and systems for converting a Prism-based filter network into one or more corresponding convolutional filters, which may have reduced computation and memory requirements, thus providing a novel and effective means of convolutional filter design. Such convolutional filters may prove particularly effective for spectral analysis, providing powerful, flexible, and precise enhancements to the very widely used Fast Fourier Transform.
According to a first aspect of the invention there is provided a filter system for filtering an input signal, the filter system comprising: a network of Prism filters arranged to receive the input signal as an input, the network of Prism filters comprising at least one cosine Prism filter and at least one sine Prism filter, wherein each Prism filter is configured to evaluate combinations of double integrals of the form:
where s(t) is an input to the respective Prism filter, m is a characteristic frequency of the respective Prism filter, [sin|cos] represents a sine or a cosine operation, q is an optional, arbitrary phase offset variable, and h is a harmonic number of the respective Prism filter of the network of Prism filters. Each cosine Prism filter is configured to determine a respective cosine output Gch, where Gch=Icsh−Isch. Each sine Prism filter is configured to determine a respective sine output Gsh, where Gsh=Issh+Icch. The network of Prism filters comprises a first branch in parallel with a second branch, each of the first branch and second branch arranged to receive the input signal as an input, the first branch comprising the at least one cosine Prism filter, the second branch comprising the at least one sine Prism filter, and wherein the network of Prism filters is arranged to generate an output signal based on a combination of an output of the first branch with an output of the second branch.
The input signal is a signal measured from and/or representing a physical entity or physical parameter. The input signal may be a signal measured by a (physical) sensor. The input signal may be a signal measured by a scientific or industrial instrument. The input signal may be, or be a representation of, an audio signal, video signal, communications signal, system control signal, seismological signal, biological signal, electrical power signal, radar signal, sonar signal, or signal representing measurements of physical quantities measured by a scientific or industrial instrument.
In contrast to the prior art filter systems discussed above, the filter systems of the first aspect of the present invention use two branches of filters in parallel, one cosine, one sine. This approach allows more flexibility in the design of the filter system, allowing filtering with a sharper passband cut-off and/or flatter intra-passband shape. This can provide better filtering performance, for the same filter length, and thus same delay time, as the previous systems.
In some embodiments the first branch comprises two or more cosine filter sets connected in series such that an output of a respective preceding cosine filter set in the series is input into a respective subsequent cosine filter set of the series, wherein the output of the first branch is an output of a final cosine filter set in the series, and wherein each cosine filter set comprises at least one cosine Prism filter, and wherein the second branch comprises two or more sine filter sets connected in series such that an output of a respective preceding sine filter set in the series is an input into a respective subsequent sine filter set of the series, wherein the output of the second branch is an output of a final sine filter set in the series, and wherein each sine filter set comprises at least one sine Prism filter.
In some embodiments the first branch comprises an even number of cosine filter sets, and the second branch comprises an even number of sine filter sets.
Using two filter sets (or any even number of filter sets) per branch allows the two branches to be linearly combined (e.g., summed). With even number of filter sets the phase at the output of each branch will be the same, allowing direct combination without additional processing, avoiding distortion of the phase characteristics of the combined signal.
In some embodiments, one or more of the cosine filter sets and/or one or more of the sine filter sets comprises a plurality of cosine/sine Prism filters connected in parallel such that the input to the respective cosine/sine filter set is input into each of the plurality of cosine/sine Prism filters of that cosine/sine filter set, and the output of the respective cosine/sine filter set is a combination of the outputs of the plurality of cosine/sine Prism filters of that cosine/sine filter set. In other words, the filter set may comprise two branches connected in parallel, each branch comprising filters connected in parallel to form respective sets. The various sets of each branch are connected in series. A respective weight may be applied to the output of each of the plurality of cosine/sine Prism filters of a cosine/sine filter set prior to generating the output of that cosine/sine filter set. In this way the impact of each set on the final output can be tailored to the desired properties of the filter set.
In some embodiments, the weights are selected using optimisation based on gain functions of the Prism filters of the filter network. It has been found that this is an efficient process for deriving weightings that achieve a desired filtering response of the filter system.
In some embodiments, the network of Prism filters comprises a combined filter set comprising at least one combined Prism filter, each combined Prism filter configured to determine a respective cosine output Gch and a respective sine output Gsh, wherein the combined filter set is arranged to provide a first filter set of both the first branch and the second branch by receiving the input signal and outputting a cosine output to the first branch and a sine output to the second branch. This arrangement generates the same cosine and sine outputs that would be generated by separate first sets of cosine and sine filters, but is more computationally efficient.
In some embodiments, the filter system further comprises a tracker formed of one or more Prism filters, wherein the tracker is configured to receive the output signal from the network of Prism filters, and to generate an output indicative of a parameter of the input signal. For example the output may be indicative of one more or more of the amplitude, phase, and frequency of the input signal. Such embodiments directly provide useful parameters of the input signal by application of the filter system, without requiring further computation.
In some embodiments the filter system further comprises a tracker formed of one or more Prism filters, wherein the tracker is configured to receive the output signal from the network of Prism filters, and to generate one or more outputs selected from the group comprising: Gc1, Gs1, Gc2, and Gs2, where Gch=Icsh−Isch, Gsh=Issh+Icch, Gc1=Gch when h=1, Gc2=Gch when g=2, Gs1=Gsh when h=1, and Gs2=Gsh when h=2. These outputs can be combined to derive parameters of the input signal. Alternatively such filter systems can be used to generate convolutional filters, with the advantages described below in relation to the fifth aspect of the invention.
In accordance with a second aspect of the invention there is provided a method of filtering an input signal, the method comprising instantiating a filter system according to any embodiment of the first aspect, and inputting the input signal into the instantiated filter system to filter the input signal.
In accordance with a third aspect of the invention there is provided a method of designing a convolutional filter for filtering an input signal, the method comprising: generating a filter system arranged to receive the input signal, the filter system comprising at least one Prism filter, wherein: each Prism filter is configured to evaluate double integrals of the form:
where s(t) is an input to the respective Prism filter, m is a characteristic frequency of the respective Prism filter, [sin|cos] represents a sine or a cosine operation, q is an optional and/or arbitrary phase offset variable, and h is a harmonic number of the respective Prism filter, inputting a test signal into the filter system to generate an impulse response of the filter system; and generating a convolutional filter for filtering the input signal based on the impulse response of the filter system. In preferred embodiments, the test signal is an impulse signal. The motivation behind the prior art Prism filters was to replace convolutional FIR filters to improve computational efficiency. The computational cost of a long Prism filter can be more than ten million times less than an equivalent conventional convolutional FIR filter. However. the memory storage requirements for such Prism filters can be substantially higher than for a convolutional filter. Surprisingly, it has been found that the memory storage requirements can be reduced by converting a constructed Prism filter into a convolutional filter. The resulting convolutional filter retains the beneficial filtering properties from the Prism filter, without requiring the same memory storage requirements.
As for the first aspect, the input signal is a signal measured from and/or representing a physical entity or physical parameter. The input signal may be a signal measured by a (physical) sensor. The input signal may be a signal measured by a scientific or industrial instrument. The input signal may be, or be a representation of, an audio signal, video signal, communications signal, system control signal, seismological signal, biological signal, electrical power signal, radar signal, sonar signal, or signal representing measurements of physical quantities measured by a scientific or industrial instrument.
In some embodiments, the impulse response is output directly as the convolutional filter. In other embodiments additional processing may be performed to generate the convolutional filter.
Some embodiments further comprise combining the generated convolutional filter with a tracker arranged to receive the output of the convolutional filter, wherein the tracker comprises a Prism filter configured to generate an output indicative of a parameter of the input signal input into the convolutional filter. The single (or few) Prism tracker may not add significantly to the memory requirements of the generated filter system, but is able to directly output useful information about the input signal. The parameter of the input signal may be at least one of: amplitude, phase, and frequency. In alternative embodiments the Prism filter system itself is or comprises a tracker configured to generate an output indicative of a parameter of the input signal, such that the generated convolutional filter acts as a tracker configured to generate an output indicative of the parameter of the input signal.
In preferred embodiments, the Prism filter system is a filter system according to any embodiment of the first aspect. However, it will be appreciated that the filter system may comprise any other arrangement of Prism filters.
In some embodiments, the filter system is arranged to generate an output selected from the group comprising: Gc1, Gs1, Gc2, and Gs2, such that the convolutional filter is configured to generate a corresponding output Gc1, Gs1, Gc2, or Gs2, where Gch=Icsh−Isch, Gsh=Issh+Icch, Gc1=Gch when h=1, Gc2=Gch when h=2, Gs1=Gsh when h=1, and Gs2=Gsh when h=2. Alternatively the filter system may comprise a low-pass or band-pass Prism filter and a tracker Prism filter, the low/band-pass filter arranged to filter an input signal, and the tracker filter arranged to generate the respective output Gc1, Gs1, Gc2, or Gs2 from the output of the low-pass filter, resulting in the convolutional filter generating the corresponding output. The outputs of such convolutional filters can be combined to generate one or more properties of the input signal, similarly to the equivalent outputs directly from the Prism system discussed above. In cases such as filters with long sample lengths, it may be preferable to use the convolutional form of the filters rather than the Prism filter system. Further advantageously, such outputs can be further processed using a FFT algorithm, as discussed further below.
In accordance with a fourth aspect of the invention there is provided a method of filtering an input signal, the method comprising instantiating one or more convolutional filters designed using the method of any embodiment of the third aspect, and inputting the input signal into the instantiated filter(s) to filter the input signal.
In accordance with a fifth aspect of the invention there is provided a method of filtering an input signal, the method comprising: providing two or more convolutional filters, each convolutional filter of the two or more convolution filters generated using one of the embodiments of the third aspect which cause the convolutional filters to generate a respective one of the outputs Gc1, Gs1, Gc2 and Gs2; applying each of the two or more convolutional filters to the input signal to generate the outputs Gc1, Gs1, Gc2, and Gs2; and generating at least one of the amplitude, frequency and phase of the input signal based on the outputs Gc1, Gs1, Gc2, and Gs2.
In some embodiments, the two or more convolutional filters comprise four convolutional filters, each convolutional filter of the four convolutional filters generated wherein: applying each of the four convolutional filters comprises: heterodyning the input signal using a plurality of heterodyne frequencies selected based on a pass-band of the low-pass or band-pass Prism filter, and applying each of the four convolutional filters to the heterodyned input signal for each heterodyne frequency to generate the outputs Gc1, Gs1, Gc2, and Gs2 for each heterodyne frequency; and generating at least one of the amplitude, frequency and phase of the input signal comprises generating the at least one of amplitude, frequency and phase of the heterodyned input signal for each heterodyne frequency based on the outputs Gc1, Gs1, Gc2, and Gs2 generated for that heterodyne frequency. Heterodyning allows the convolutional filters to be applied to input signals with arbitrary frequencies. Heterodyning shifts a continuous range of frequencies which are to be analysed into the passband range of the convolutional filters (as designed by the initial Prism system). By applying multiple heterodyne frequencies to the input signal, various frequency components of the signal can shifted successively into the filter passband. Thus the filter outputs can be derived for a range of frequencies, allowing spectral analysis of the input signal. For example the filter outputs can be combined to determine a property of the input signal, such as amplitude or phase. The heterodyning approach allows a spectral analysis of such properties.
In some embodiments, a Fourier transform algorithm is applied to the output of each convolutional filter of the two or more convolutional filters to generate two or more of the outputs Gc1, Gs1, Gc2, and Gs2. The Fourier transform algorithm is preferably a fast Fourier transform (FFT) algorithm. Such embodiments are particularly advantageous. They allow spectral analysis of an input signal using the computationally efficient FFT process. The initial design from the Prism filter system provides sharp stopband attenuation, which suppresses the spectral leakage that is problematic in conventional FFT applications.
In some embodiments, the method further comprises: estimating frequencies of peaks in the generated amplitude, frequency and/or phase (using either the FFT or heterodyne approaches); and reapplying each of the two or more convolutional filters to the input signal based on the estimated peak frequencies to generate updated values for amplitude, frequency and/or phase by: heterodyning the input signal using heterodyne frequencies corresponding to each of the estimated peak frequencies; and applying each of the two or more convolutional filters to the heterodyned input signal for each heterodyne frequency corresponding to an estimated peak frequency to generate two or more of the outputs Gc1, Gs1, Gc2 and Gs2 for each heterodyne frequency; and generating updated values for amplitude, frequency and/or phase of the heterodyned input signal for each heterodyne frequency corresponding to an estimated peak frequency based on the at least two outputs selected from Gc1, Gs1, Gc2, and Gs2 generated for that heterodyne frequency. Such embodiments allow the initial estimates of parameters of the input signal, such as amplitude and/or peak frequency, to be refined, providing more accurate results.
In accordance with a sixth aspect there is provided a method of estimating characteristics of an input signal, the method comprising: inputting the input signal into a first tracker to determine a first estimate of characteristics of the input signal, the first estimate comprising a first amplitude estimate and a first frequency estimate, determining a normalised signal from the input signal by: normalising the amplitude of the input signal using the first amplitude estimate; and/or heterodyning the input signal using a heterodyne frequency determined based on a sum and/or difference between the first frequency estimate and a filter frequency; and inputting the normalised signal into a second tracker to determine a second estimate of characteristics of the input signal, the second tracker comprising at least one Prism filter, wherein the second tracker is configured to pass a narrower range of frequencies than the first tracker, and wherein the second tracker is configured to pass the filter frequency; wherein at least one of the first tracker and the second tracker comprises or is derived from at least one Prism filter, wherein: each Prism filter is configured to evaluate double integrals of the form:
where s(t) is an input to the respective Prism filter, m is a characteristic frequency of the respective Prism filter, [sin|cos] represents a sine or a cosine operation, and q is an optional phase offset variable, and h is a harmonic number of the respective Prism filter.
In conventional filters, there is typically a tradeoff between achieving good noise suppression, and successfully tracking a dynamic change in the input signal. A filter which is strong enough to suppress noise may also suppress rapid dynamic changes. Embodiments of the sixth aspect provide tracking of dynamic changes in combination with good noise suppression. This is achieved by using two filtering stages. The first stage provides approximate estimates of amplitude and/or frequency of the input signal. These estimates can be used to normalise the input signal, ‘levelling’ amplitude peaks and placing the frequency of the normalised signal in the range of a narrowband Prism filter. The narrowband filter can then provide a more accurate estimate of the amplitude and/or frequency of the input signal.
In preferred embodiments, the first tracker and/or second tracker comprises or is derived from a filter system according to any embodiment of the first aspect. The first and/or second tracker may be implemented as a Prism, i.e. by instantiating a network of Prism filters and inputting the input signal into the network of Prism filters. Alternatively, the first and/or second tracker (or part thereof) may be a convolutional filter derived from a network of Prism filters. In particular, the first and/or second tracker (or part thereof) may be a convolutional filter generated using the method of any embodiment of the third aspect. Such convolutional filters can provide the filtering advantages of Prism instantiations, without the requirement for large memory storage of Prism coefficients. Inputting the signals into the first tracker and/or second tracker may comprise performing the method of any embodiment of the fifth aspect.
In some embodiments the first tracker and/or second tracker comprises a filtering component and a tracking component. The filtering component may be a convolutional filter as above. The tracking component is or comprises a Prism filter. That is, the tracking component is a Prism instantiation. The tracking component itself may have relatively few coefficients to store, and so may be more practical to implement as a Prism instantiation than the larger filtering component.
In some embodiments, respective values of the first amplitude estimate and/or first frequency estimate are determined for each of a plurality of samples in the input signal. Normalising the amplitude of the input signal may comprise dividing each of the plurality of samples of the input signal by the respective value of the first amplitude estimate. Heterodyning the input signal may comprise heterodyning each of the plurality of samples of the input signal based on a sum and/or difference of the respective value of the first frequency estimate and the target frequency. Such embodiments provide a fully dynamic normalisation of the input signal, adapting to changes during the course of the input signal which allows the second tracker provide accurate estimates of the amplitude and/or frequency of the input signal at a particular moment in the input signal.
According to a seventh aspect of the invention there is provided a signal characterisation device for estimating characteristics of an input signal, the device comprising: a first tracker configured to determine a first estimate of characteristics of the input signal; a second tracker configured to determine a second estimate of the characteristics of the input signal; and a control unit configured to perform the method of any embodiment of the sixth aspect to estimate characteristics of the input signal; wherein at least one of the first tracker and the second tracker comprises or is derived from at least one Prism filter.
According to an eighth aspect of the invention there is provided a method of filtering an input signal, the method comprising: applying a sequence of one or more filter stages to the input signal, wherein: the input to a first filter stage in the sequence is the input signal, and the input to any subsequent filter stages in the sequence is a respective downsampled signal generated by an immediately preceding filter stage; and applying a respective filter stage of the sequence of one or more filter stages comprises: heterodyning the input for the respective filter stage based on a respective target frequency and a respective filter frequency; applying a respective convolutional filter to a subset of samples of the heterodyned input selected based on a respective downsampling factor, the respective convolutional filter configured to pass the respective filter frequency; generating a respective downsampled signal from outputs of the respective convolutional filter applied to the subset of samples; and applying a tracker stage to the downsampled signal generated by a final filter stage in the sequence of one or more filter stages, wherein applying the tracker stage comprises: heterodyning the downsampled signal generated by the final filter stage based on a tracker target frequency and a tracker filter frequency; applying a tracker filter to the heterodyned downsampled signal generated by the final filter stage to determine one or more characteristics of the input signal; wherein each respective convolutional filter is derived from a network of Prism filters comprising at least one Prism filter, and the tracker filter comprises or is derived from at least one Prism filter, wherein each Prism filter is configured to evaluate double integrals of the form:
where s(t) is an input to the respective Prism filter, m is a characteristic frequency of the respective Prism filter, [sin|cos] represents a sine or a cosine operation, and q is an optional phase offset variable, and h is a harmonic number of the respective Prism filter.
Embodiments of the eighth aspect provide ultra-narrowband filtering of an input signal. This may be used for example for tracking small frequency changes of a component of the input signal. It has previously been demonstrated that networks of Prism filters can provide ultra-narrow filtering, for example down to a 0.01 HZ passband on a 20 MHz sampled signal. However, such Prism networks can require a large amount of memory to store filter coefficients. Embodiments of the eighth aspect use the realisation that Prism networks can be converted to a convolutional form (as discussed in relation to the third aspect). Such convolutional filters retain filtering ability with reduced memory requirements. Embodiments of the eighth aspect leverage such convolutional filters in combination with downsampling and heterodyning, resulting in computationally efficient ultra-narrowband filtering.
In some embodiments, applying the final filter stage further comprises determining an estimate of characteristics of the respective input to the final filter stage by applying an estimator tracker to the respective subset of samples of the final filter stage, wherein the estimate of characteristics comprises one or more of frequency, phase and/or amplitude estimates, and wherein the estimator tracker is derived from at least one Prism filter. In some embodiments these estimates can be used as a sense check on the downsampling parameters. Advantageously, however, the estimates can also be used to normalise the signal input into the tracker filter, similarly to the method of the sixth aspect. This can improve the accuracy accurate of the characteristics of the input signal determined by the tracker filter. In particular, in some embodiments the estimate of characteristics comprises a frequency estimate; and in the step of applying the tracker stage, the frequency estimate is used as the tracker target frequency. Alternatively or additionally, in some embodiments the estimate of characteristics comprises an amplitude estimate; and in the step of applying the tracker stage, the heterodyned downsampled signal generated by the final filter stage is normalised using the amplitude estimate prior to before applying the tracker filter. Such embodiments may further use any embodiment of the method of the sixth aspect.
In some embodiments, each respective convolutional filter is generated from an impulse response of a network of Prism filters. In particular, each respective convolutional filter may be generated using the method of any embodiment of the third aspect. The convolutional filters may be derived from a filter system according to any embodiment of the first aspect.
In accordance with an ninth aspect of the invention, there is provided a filter system for filtering an input signal, the filter system comprising: a sequence of one or more filter stages, each filter stage of the one or more filter stages comprising a respective convolutional filter, the first filter stage configured to receive the input signal as an input, and each subsequent filter stage configured to receive an output of an immediately preceding filter stage in the sequence of filter stages as a respective input; a tracker stage comprising a tracker filter configured to receive an output of a final filter stage of the sequence of filter stages as an input; and one or more heterodyne blocks configured to heterodyne the respective inputs of each filter stage; wherein the filter system is configured to perform the method of any embodiment of the eighth aspect.
In any embodiment of the sixth to ninth aspects, the characteristics of the input signal may include a frequency of the input signal. The method may further comprise detecting a change in the frequency of the input signal. Alternatively or additionally, the method may further comprise calibrating a clock frequency based on the determined frequency of the input signal.
In any embodiment of the first to ninth aspects, the input signal may be, or may be a representation of, an audio signal, video signal, communications signal, system control signal, seismological signal, biological signal, electrical power signal, radar signal, sonar signal, or signal representing measurements of physical quantities measured by a scientific or industrial instrument.
In any embodiment of the first to ninth aspects, the filter system or convolutional filter/s (i.e. the convolutional filter/s generated by the method) may be for low pass or bandpass filtering of the signal.
In any embodiment of the first to ninth aspects, the filter system or convolutional filter/s may be for filtering a signal output by a sensor or other physical instrument measuring a physical parameter, or may be configured to filter a signal output by a sensor or other physical instrument. The filter system or convolutional filter/s may be part of the sensor or physical instrument, and/or may directly receive the signal from the sensor and/or physical instrument. In any embodiment of the first to ninth aspects, the input signal may be, or may be a representation of, a signal output by a sensor.
In any embodiment of the first to ninth aspects, the filter system or convolutional filter/s may be for filtering signals from a Coriolis meter, or may be configured to filter an input signal received from a Coriolis meter. In any embodiment of the first to ninth aspects, the input signal may be or may represent a measurement taken by a Coriolis meter.
According to a tenth aspect of the invention there is provided a Coriolis meter comprising a filter system, convolutional filter, signal characterisation device according to any embodiment of the first to fifth, seventh, or ninth aspects, or configured to perform the method of any embodiment of the third, fifth, sixth, or eighth aspects.
In any embodiment of the first to ninth aspects, the filter system or convolutional filter/s may be for filtering signals representative of medical images, or configured to filter signals representative of medical images. In any embodiment of the first to ninth aspects, the input signal may be a signal representative of a medical image.
In any embodiment of the first to ninth aspects the filter system or convolutional filter/s may be for filtering biological signals, or configured to filter biological signals. In any embodiment of the first to ninth aspects the input signal may be a biological signal.
The biological signals may in particular embodiments by neural signals.
In any embodiment of the first to ninth aspects the filter system or convolutional filter/s may be for filtering communications signals or audio signals, or may be configured to filter communications signals or audio signals. In any embodiment of the first to ninth aspects the input signal may be a communications signal or audio signal.
The filter system, convolutional filter/s, signal characterisation device, or method of any embodiment of the first to ninth aspects may be implemented on a computer, or may be implemented on a computer readable medium, or may be implemented as a computer program.
According to an eleventh aspect of the invention there is provided a sensor device comprising a sensor configured to measure one or more physical parameters; and a filter block configured to receive an input signal from the sensor representative of the measured physical parameter and to output a filtered signal. The filter block comprises an instantiation of the filter system and/or convolutional filter/s of any embodiment of the first to ninth aspects, wherein the instantiation of the filter system/convolutional filter/s is configured to receive and filter the input signal to generate the filtered signal. Alternatively or additionally, the filter block may be configured to perform the method of any of the second to sixth or eighth aspects.
According to a twelfth aspect of the invention there is provided a computer program storing instructions which, when executed by a computer cause the computer to perform the method of any embodiment of the second to sixth or eighth aspects.
According to a thirteenth aspect of the invention there is provided a computer readable medium storing instructions which, when executed by a computer cause the computer to perform the method of any embodiment of the second to sixth or eighth aspects. The computer readable medium may be a transitory or non-transitory computer readable medium.
Embodiments of the invention will now be described, by way of example only, with reference to the accompanying drawings in which corresponding reference symbols indicate corresponding parts, and in which:
An example of the Prism constitutes a low pass FIR filter (or a coupled pair of filters) that can use a recursive sliding window technique, so that the computation burden is independent of the window length, with linear phase response and good numerical stability. The properties of the Prism have previously been disclosed in [A, 1] which are incorporated herein by reference in their entirety. Two or more Prisms may be combined into a chain or network to meet more sophisticated signal processing requirements, such as the provision of low pass or band pass filtering to a desired specification. Any single output Prism can be extended to provide a second output, where the two outputs are generally orthogonal (e.g., having a phase difference of π/2 radians). A variety of sinusoid trackers can be constructed to calculate estimates of the frequency, phase and/or amplitude of the monitored signal, each using a Prism network and a detection calculation.
Examples of the Prism filters may be incorporated into systems, utilizing mechanical or electronic sensors and/or microprocessors or other devices capable of computation, or methods using the disclosed techniques. The methods and systems utilizing an example of the Prism perform double integrals of the form:
Here the notation [s|c] is used to indicate the selection of one alternative between s (for sine) and c (for cosine). h is the harmonic number, normally a small positive integer, usually 1, 2, or 3. m may be the characteristic frequency of the Prism.
Although the mathematical analysis described in this disclosure may be stated in terms of continuous notation (for example using integration rather than summation), it will be understood by those familiar with the art that a practical implementation may be based upon digitally sampled signals, and that mathematical results in the continuous domain can, with due care, be mapped onto the discrete time domain. For example, Romberg Integration, (described in J. Dutka, “Richardson Extrapolation and Romberg Integration”, Historia Mathematica, Vol. 11, (1984) pp 3-21), is one technique that may be applied to obtain accurate results from discrete samples of data, which may provide a good approximation to the theoretical value of the continuous integral equivalent.
With regard to the discrete-time implementation of an example of the Prism, given a sampling rate fs, the choice of m is restricted to ensure that f/rm is an integer: this quantity gives the whole number of samples in each of the two data windows used for numerical integration. Where Romberg Integration is used, slightly greater restrictions are placed on the selected value of m, for example that fs/m must be a positive multiple of some power of two (for example 4n, where n is any positive integer).
The integral limits may be selected so that ϕ, the phase of s(t) at t=0, is also the phase of the most recent sample. In other words, calculating ϕ can give the phase at the end of the data window, rather than (for example) the phase at the mid-point of the double integral. Note that the double integral extends in time from −2/m to 0: its duration is 2/m. Accordingly, viewed as an FIR filter, this example can be considered as having an order (i.e., the length of the data window in samples) of 2 fs/m.
The harmonic number can be considered in the following terms. Over each integral window, the modulation function constitutes a sinusoid (either sine or cosine) that is multiplied by the input signal: for the inner integral, the input constitutes the original signal s(t); for the outer integral the input constitutes the value supplied as an output from the inner integral. When the harmonic number is one, one complete cycle of the modulation function can stretch over the window of data associated with each integral: thus the frequency of the modulation function is m. When the harmonic number is two, two cycles exactly cover each data window, and thus the frequency of the modulation function is 2m, and so on.
As developed and explained in previous disclosures, the following useful results may be derived:
Here r is the frequency ratio of the input sinusoid, defined as:
so that r=0 when f=0 Hz and r=1 when f=m Hz. sinc(x) is the normalised sinc function defined as follows:
Gsh in equation 2 is also referred to as Gsh in this disclosure; similarly, Gch in equation 3 is also referred to as Gch in this disclosure.
The simple analytic expressions for the double integral groups given in Equations 2 and 3 are a key advantage of filters based on the Prism technique. The Prism may be defined as a signal processing object that receives a time series signal as an input, and which generates, via numerical integration, one or more time dependent outputs. These time-dependent outputs may correspond to the sample-by-sample values of one or both of Gs
Prism Signal Processing, described above and in “The Prism: Efficient Signal Processing for the Internet of Things,” IEEE Industrial Electronics Magazine, pp 2-10, December 2017. DOI: 10.1109/MIE.2017.2760108 by MP Henry, F Leach, M Davy, O Bushuev, M S Tombs, FB Zhou, and S Karout (ref. [5]), which is incorporated herein by reference in its entirety, constitutes a new FIR technique particularly suited to the requirements of autonomous computing and for intelligent, adaptive components in Cyber-Physical Systems and the Internet of Things (IoT).
The present disclosure relates to Prism filter systems comprising a network of filter systems, and to methods of designing and using convolutional filters that are based on Prism filter systems. The basic building block of these filter systems is a Prism filter. An example of a Prism filter 100 is shown in
Each Prism filter 100 is configured to evaluate combinations of double integrals of the form:
where s(t) is an input to the respective Prism filter, m is a characteristic frequency of the respective Prism filter, [sin|cos] represents a sine or a cosine operation, q is an optional, arbitrary phase offset variable, and h is a harmonic number of the respective Prism filter of the network of Prism filters. As noted above, evaluating the double integrals may comprise performing the integral using continuous data, or performing a discrete time equivalent, for example based on Romberg integration.
The exemplary representation of the Prism filter 100 in
The properties of a Prism filter 100 are defined by its characteristic frequency m and harmonic number h. Structurally, the Prism comprises at least four and up to six integration blocks, where the input to each is multiplied by a sine or cosine function with frequency h*m Hz and integrated over the period 1/m seconds to generate the corresponding output. Accordingly, each integration block may be considered as analogous to the Discrete Fourier Transform (DFT), well known to those familiar with the art. The Prism integration block calculation can be performed recursively, as the final Prism outputs can be independent of the instantaneous phase of the sinusoidal modulation functions. In examples of the Prism, the equivalent of filter coefficients are linearly spaced sine and cosine values, so that, for desired values of fs, m and h, the design calculation can be straightforward.
Prism signal processing can offer a unique combination of desirable properties: the calculation is FIR, and hence robust; the outputs have linear phase delay; the calculation is fully recursive so that the computational cost per sample is low and fixed, irrespective of the length of the filter, and its design can be straightforward, given desired values offs, m and h, requiring only the evaluation of linearly spaced sine and cosine values.
In some examples, the low pass-filter design uses layers of single output Prisms which calculate either Gsh or Gch, and where a layer consists of two or more Prisms operating in parallel. Given m, the characteristic frequency of a Prism, and h its harmonic number, the gain of Gsh at frequency f, denoted by Γs, is given in equation (6):
while the gain of Gch at frequency f denoted by Γc, is given by equation (7):
The filter system 200 comprises a network of Prism filters 201. The network of Prism filters 201 comprises a first branch 210 in parallel with a second branch 220. Each of the first branch 210 and second branch 220 is arranged to receive the input signal s(t) as an input. The first branch 210 comprises at least one cosine Prism filter 211, arranged to generate a cosine output Gch as discussed above. The second branch 220 comprises at least one sine Prism filter 221, arranged to generate a sine output Gsh as discussed above. The network of Prism filters 201 is arranged to generate an output signal 230 based on a combination of an output of the first branch 210 with an output of the second branch 220. In preferable examples, the first branch 210 comprises two or more cosine Prism filters 211 connected in series, and the second branch 220 comprises two or more sine Prism filters 221 connected in series, as illustrated further below. By combining cosine and sine Prisms in parallel, the filtering ability of the system 200 may be increased, without increasing the length of the filter, and hence the time delay needed to filter a signal.
In preferred examples, the output 230 is a linear combination (e.g. sum or weighted sum) of the output of the first branch 210 and the output of the second branch 220. As will be appreciated, other combinations are possible, taking into account any phase difference between the output of the cosine first branch 210 and the sine second branch 220.
As shown in the example filter system 200 illustrated in
Although the first branch 210 and second branch 220 may comprise only one Prism filter each, in preferred examples each branch 210, 220 comprises multiple Prism filters. Within a branch 210, 220, the multiple Prism filters may be connected in series and/or in parallel with each other.
In filter systems 200 such as that of
Furthermore, one or more of the cosine filter sets 211, 212 and/or one or more of the sine filter sets 221, 222 may comprise a plurality of cosine (for cosine filter sets)/sine (for sine filter sets) Prism filters 211a-c, 221a-c, 212a-c, 222a-c connected in parallel such that the input to the respective cosine/sine filter set 211, 212, 221, 222 is input into each of the plurality of cosine/sine Prism filters 211a-c, 221a-c, 212a-c, 222a-c of that cosine/sine filter set 211, 212, 221, 222, and the output of the respective cosine/sine filter set is a combination of the outputs of the plurality of cosine/sine Prism filters 211a-c, 221a-c, 212a-c, 222a-c of that cosine/sine filter block set 211, 212, 221, 222.
The example of
In the example illustrated in
In some examples the second branch 220 comprises a corresponding sine filter set 221, 222 for each cosine filter set 211, 212 of the first branch 210, wherein the harmonic number, h, of a sine Prism filter 221a-c, 222a-c in a sine filter set 221, 222 matches the harmonic number, h, of a cosine Prism filter 211a-c, 212a-c in the corresponding cosine filter set 211, 222.
Further, in some embodiments each cosine/sine filter set 211, 212, 221, 222 may comprises n cosine/sine filters 211a-c, 221a-c, 212a-c, 222a-c. For each cosine/sine filter set 211, 212, 221, 222, each of the plurality of cosine Prism filters 211a-c, 221a-c, 212a-c, 222a-c may comprise a respective harmonic number hi such that a set of harmonic numbers h1, . . . hn is used within the respective cosine filter set 211, 212, 221, 222. The set of harmonic numbers h1, . . . hn of cosine Prism filters 211a-c, 212a-c, of each cosine filter set 211, 212, is the same. Alternatively or additionally, the set of harmonic numbers h1, . . . hn of sine Prism filters 221a-c, 222a-c, of each sine filter set 221, 222, may be the same.
The filter system 200 of
To provide further tunability to the filter system 200, a respective weight may be applied to the output of each of the plurality of cosine/sine Prism filters 211a-c, 221a-c, 212a-c, 222a-c of a cosine/sine filter set 211, 212, 221, 222 prior to generating the output of that cosine/sine filter set 211, 212, 221, 222. In
As discussed above, at all frequencies, the three Prism outputs of each set are in phase with one another, so that they can be linearly combined without introducing phase distortion. However, there is a phase difference of π/2 radians between the output of the first sine set 221 and the output of the first cosine set 211 which together constitute the first layer of the filter.
The second layer of the filter in
In a more computationally efficient instantiation, the network of Prism filters 201 may comprise a combined filter set comprising at least one combined Prism filter 100, similar to the filter 100 shown in
Filter design may consist of selecting weights to provide the desired frequency response characteristic of the filter.
In one approach, the weights are selected using optimisation based on gain functions of the Prism filters of the filter network. For example, weight selection may be achieved by defining an optimization problem which may be solved using conventional tools familiar to those practicing the art—for example Matlab®. An example optimization calculation for a two layer filter may be implemented as follows. The weights w1-w9 are the unconstrained variables, the values of which are to be optimized according to some cost function to be determined. For a given set of wi, the corresponding frequency response may be calculated analytically over a range of values of r, for example r=f/m=0, 0.01, . . . , 10, using the gain functions given in Equations (6) and (7), along with the specific filter design structure and wi values as exemplified in
These filter system 200 designs are independent of any particular selection of the characteristic frequency m. Once a filter design is complete, it may be instantiated with any desired value of m (and hence the desired filter cutoff frequency) as required for a particular application, subject to the previously noted constraints that, due to sampling discretization, the ratio m/fs must be an integer. As described in [4], such low pass Prism filter system designs may be used in conjunction with the technique of heterodyning, well known to those familiar with the art, in order to apply band pass filtering. As also described in [4], such a filter may be used together with a Prism tracker 202 [1], to generate frequency, amplitude and/or phase estimates of the resulting filtered signal.
Filter designs such as those shown in
The filter system 200 described above may be used in a method of filtering an input signal. Such a method 300 is illustrated in
One of the original motivations for the development of the Prism was the desire to improve computational efficiency for FIR filtering by the introduction of a recursive calculation, which advantageously has a fixed computational cost irrespective of filter length. As described in [2], for long filters (say in excess of 1 billion samples), the computational cost of Prism filter operation may be reduced by a factor of more than ten million compared with that of an equivalent convolutional FIR filter. A further benefit is the low cost and simplicity of Prism filter design and instantiation compared with the various techniques for designing convolutional filters [A, 1]. However, the memory storage requirements for such Prism filters may be significantly higher than for a convolutional filter.
The computational advantage of the Prism technique over the convolutional FIR filter may be lower for shorter filter lengths. Furthermore, where large numbers of Prisms are used to instantiate a particular filter system design (for example 72 Prisms are used to instantiate a 12 layer filter design based on the structure shown in
Further potential benefits of a convolutional implementation of a Prim-based filter design include the following. The Prism's recursive form of filter update calculation is designed for real-time operation, and assumes that an update is performed every sample. There are applications where parameter estimates, for example of frequency, phase and/or amplitude, may be required less frequently than once per sample. There may also be data analysis applications, for example in spectral analysis, where a data set may be static, rather than changing dynamically in time. In such cases, it may be computationally advantageous to apply a single convolution calculation to the entire data set, rather than treat the data set as a time series to be processed on a sample-by-sample basis.
As noted above, there may be situations where it is preferable to instantiate the filter system as a convolutional filter, rather than as a Prism instantiation. To achieve the beneficial filtering characteristics of the Prism network, methods according to the present disclosure first construct a filter system, and then generate a convolutional filter using the Prism filter system.
The generated filter system may be a filter system according to the examples described above in relation to
In some examples, the filter system is or comprises a tracker (i.e. a tracker Prism as described above) configured to generate an output indicative of a parameter of the input signal, such that the generated convolutional filter acts as a tracker configured to generate an output indicative of the parameter of the input signal. The parameter of the input signal may comprise at least one of: amplitude, phase, and frequency. Alternatively, the ultimately generated convolutional filter, described further below, may be combined with a tracker Prism to generate the output indicative of the parameter of the input signal.
In general, generating the filter system may comprises selecting, based on the input signal or a physical system represented by the input signal, at least one of: a number of Prism filters within the filter system; an arrangement of Prism filters within the filter system; a harmonic number of one or more of the Prism filters within the filter system; a characteristic frequency of one or more Prism filters within the filter system. For example one or more of these parameters may be selected based on a maximum desired time delay introduced by the filter. Additionally or alternatively, one or more of these parameters may be selected based on a maximum desired length of the filter (e.g. due to computational constraints). Additionally or alternatively, one or more of these parameters may be selected based on desired passband characteristics, such as shape across the pass band (e.g. approximately flat gain for all frequencies in the pass band), and/or amount of attenuation after the passband. The filter system, and its parameters, may be selected based on a particular use intended for the filter.
Having generated the filter system, method 400 proceeds to step 402, at which a test signal is input into the filter system to generate a test/impulse response of the filter system. In other words, the test signal is used as an input signal for a Prism-instantiated filter system; and the resulting output of the filter system is the impulse response. In preferred examples the test signal is an impulse signal, but other appropriate signal forms may be used that generate a test/impulse response from which a convolutional filter can be generated.
Method 400 then proceeds to step 403, at which a convolutional filter for filtering the input signal is generated based on the impulse response of the filter system. In the simplest examples, where the test signal is an impulse signal, the impulse response of the Prism filter system is output as the convolutional filter. In other examples, further processing steps may be applied to generate the desired convolutional filter. For example, the impulse response may be truncated to form the convolutional filter.
For example, given the convolutional filter values ci (i=1, 2, . . . , 960) and data series xi (i=1, 2, . . . , 960), the output value yt can be calculated using the convolution of x and c as shown in Equation (8):
This equivalent filtering performance is demonstrated in
The computational load associated with evaluating the convolutional filter of Equation (8) consists of one multiply and accumulate operation for each filter coefficient [A, 1]. Here, with 960 coefficients, the resulting computation is 1920 floating point operations. By contrast, as discussed in reference 1, the computational load for updating a single output Prism is 18 multiplications and 33 additions (assuming only one stage of Romberg Integration is applied). For the 72 Prism design of
For example, the convolution calculation may be applied on an occasional basis, say, only after another ten or one hundred new samples have been received, as long as the calculation is based on the most recent 960 consecutive samples in each case. By contrast, the output of the Prism design is only valid if updates have taken place for all of the previous 960 samples.
A further advantage of this convolutional form of filtering is the reduced memory storage requirement: the calculation of Equation (8) requires only the set of coefficients, the values of the most recent samples, and an accumulator. By contrast, there are larger storage requirements for the 72 Prism filter implementation, given, for example, the need to store vectors of product values in each Prism.
In the example given above, the full impulse response of 960 samples was used to create the convolutional filter. Given the small magnitude of the impulse response at its beginning and end, shorter convolutional filters may be created by truncating those values at the beginning and end of the impulse response below a certain magnitude threshold, for example 1e−20. Reducing the filter length in this way will result in a faster dynamic response, while having only a limited impact on other aspects of filter performance.
Convolution Designs which Combine Filtering and Tracking
As disclosed in the prior art [A, B, 1-4], while single output Prisms may be advantageously employed for the instantiation of various types of filtering, dual output Prisms, generating both Gs and Gc outputs (
Commonly, a tracker is preceded in the signal processing chain by a filter, which may be used to restrict the frequency range of the input signal to match that of the signal component to be tracked.
Parameters of the input signal can be calculated as follows. Firstly, the dimensionless frequency, r, may be calculated from the values of the two Prism outputs as follows. Firstly, a ratio x is calculated, where
The estimated value of r, may then be derived using:
The corresponding estimate of the tracked frequency f is simply:
f=r*m Equation (11)
Once the value of r has been calculated, it is straightforward to calculate the amplitude A and phase ϕ of the tracked signal, as follows:
where atan is the inverse tangent function. Note that the above calculations may be subject to potential numerical instability, for example if the signal-to-noise ratio of the input signal is low, or the calculated value of r is close to a whole number. Those familiar with the art will appreciate that standard checking techniques can be applied to ensure numerical stability is preserved, with sensible default values (e.g. A=0) provided where a stable calculation is not possible with the current set of data values.
Further corrections to the calculated values of A and ϕ may be applied to compensate for the influence of the low pass filter 501 shown in
As noted above, the filtering and tracking scheme/filter system 500 of
In a third implementation, both the low pass filter 501 and the tracker Prisms 502 may be implemented as a set of four convolutions, as described below. For example, tracker 502 may be arranged to generate only one of the ‘G’ outputs. The equivalent convolutional filter generated by using such a filter system 500 in the method of 400 will thus also generate one of the ‘G’ outputs. This can be computationally advantageous where updates are required on an occasional basis, rather than with every new sample. This implementation may be particularly advantageous where a static data set is to be analysed, and where a single estimate of frequency, amplitude and/or phase is to be determined, for example in spectral analysis of a fixed data set, as discussed below. In such applications, a convolutional form of calculation, combining both low pass filtering and tracking aspects into a single set of coefficients, may result in a significantly reduced computation load, compared with a Prism instantiation requiring repeated computation on the data propagated through Prisms as a time series.
Thus some examples of the present disclosure provide a method of filtering an input signal using convolutional filters to generate an output indicative of a parameter of the input signal, such as amplitude, frequency, and/or phase of the input signal.
Method 600 then proceeds to step 603, at which an output indicative of a parameter of the input signal is generated. In particular, at least one of the amplitude, frequency and phase of the input signal may be generated based on the outputs Gc1, Gs1, Gc2, and Gs2. Step 603 may use one or more of the equations (9)-(13) (and/or (23) and (24) discussed below) to generate the at least one of amplitude, frequency, and phase. It is noted that in some examples, the outputs from step 602 may be stored and/or output to an external system. The step 603 may then be performed later as a post-processing step using the stored/transmitted outputs Gc1, Gs1, Gc2, and Gs2.
It may appear inefficient to implement four separate convolutional filters, given that the low pass filter is common to all. However, if the filtering and tracking stages are implemented as separate convolutions, for the current design where the tracker Prisms are of length 96 samples, it would require 96 separate evaluations of the low pass filter to generate a time series sufficiently long to generate a single set of tracker outputs. Accordingly, unless tracker outputs are to be generated every sample, a four convolution filter instantiation may be more computationally efficient.
Reference [4] describes some of the technical challenges associated with the spectral analysis of a fixed data set, in particular using the well-known Fast Fourier Transform (FFT), together with a potentially improved analysis made possible through the use of the Prism bandpass filtering technique previously described [B,2]. The low pass filter invention disclosed here, particularly as instantiated in the convolutional form described above, offers a simple, low cost and precise means of performing spectral analysis, which may provide substantial improvements over prior art FFT methods as well as the previously described Prism-based band pass technique. A brief review of the limitations of prior art FFT analysis is followed by the introduction of a problem example. The new Prism technique is then explained, and its performance compared with that of conventional FFT for the problem example.
Reference [4] introduces the FFT and its associated challenges as follows: “The Fast Fourier Transform (FFT) is one of the most widely used techniques in signal processing . . . , generating a set of Discrete Fourier Transform (DFT) results, linearly spaced in the frequency domain. Its key advantage is an o(n log(n)) computational cost, for a time series of length n samples. However, the extraction of frequency, amplitude and/or phase information for the spectral peaks obtained from FFT/DFT calculations remains an active research topic . . . In short, unless a peak happens to coincide exactly with a DFT/FFT frequency, interpolation and/or other techniques are required to estimate the true peak frequency and amplitude. Additional challenges include spectral leakage, where DFT/FFT processing of a peak at one frequency may result in the apparent transfer of energy to adjacent frequencies, which have negligible energy in the original signal. This in turn may result in ‘hidden tones’ whereby a true peak of low magnitude, in the near vicinity of a higher peak, is obscured.”
The conventional FFT calculation may provide, for each frequency step, a complex value with corresponding real (cosine) and imaginary (sine) parts, from which corresponding amplitude and phase terms are readily calculated; these provides estimates of the amplitude and phase of the corresponding frequency component of the original time series. Note that in this disclosure, the terms “magnitude” and “amplitude” are used interchangeably.
Reference [4] provides a working example, using two spectral peaks with amplitudes of 0.5 V and 1e−9V respectively, to explain and demonstrate the limitations of FFT, particularly with regard to hidden tones. A Prism-based spectral analysis using the band pass filtering technique is introduced, which demonstrates improved performance compared with a conventional FFT calculation. In the current disclosure the art is advanced in several important respects: the new filter structure of
A numerical example, which includes random variations, is used to illustrate the new technique and its advantages over well-established FFT methods.
As understood by those familiar with the art, a variety of techniques can be used in conjunction with the basic FFT calculation to improve the accuracy of the results obtained, for example by reducing spectral leakage. These techniques include the application of various windowing functions, as discussed below. The potential for improved results is illustrated in
The results in
To evaluate the FFT performance in more detail, a series of simulations have been carried out. In these simulations, the results obtained for the Hann+FFT variant technique have reduced errors compared with the plain FFT, and so only the Hann+FFT results are described. These are taken to be representative of a conventional modern FFT calculation, to be compared with the novel Prism-based technique described below.
The characteristics of the simulation trials reflect the key sources of error associated with the FFT, which are well known to those familiar to the art, and are discussed in [4]. In general, the FFT calculation does not identify peak frequencies or amplitudes, such as those associated with the signal components listed in Table 1, but instead it generates estimates of signal amplitude at regularly spaced intervals of frequency. The accuracy with which a signal component's amplitude is calculated by the FFT is a function of how far the component's true frequency lies from the nearest FFT frequency value. This distance is often referend to as S [4], where the frequency difference is scaled by the FFT frequency step length, and lies in the range [−0.5, 0.5]. When δ=0, the error in the FFT estimate of component amplitude is small, while for larger magnitudes of S the amplitude error can be much greater. In some applications, the true frequency of a signal component may be known, so it may be possible to select for example the sampling rate to ensure that δ=0. More generally, however, the exact frequencies of the one or more components may not be known, and/or it is not possible with multiple components to select a single sampling rate resulting in favourable values of S close to zero. Accordingly, in the simulations presented here, and as detailed below, random small variations in the frequency of each of the signal components are generated, matching the complete range δ ∈ [−0.5, 0.5], in order to evaluate the resulting distribution of amplitude error arising from the FFT calculation.
A further source of error, as previously described, is spectral leakage: commonly, the FFT calculation ‘spreads’ the influence of a high amplitude component beyond its immediate frequency, so that in its near vicinity relatively high amplitudes are reported even though there may be no local component. A ‘hidden peak’ occurs when a real but low amplitude component is not visible in an FFT spectrum because of higher amplitude spectral leakage from one or more large neighbouring peaks. This effect is illustrated in
A final source of error explored in the simulations is the standard deviation of white noise added to the pure sinusoidal components listed in Table 1. For example, in
Given these various sources of error, a demonstration of the frequency and amplitude error properties of the FFT, and the comparable performance from the new Prism-based technique, is provided as follows: Nineteen different standard deviations of additive noise are considered, ranging from 1e−10 to 1e−1, where the noise is increased by a factor of √{square root over (10)} at each step: thus 1e−10, 3.16e−10, 1e−9, . . . , 1e−1;
For each selected noise level, 20,000 simulations are carried out, where random variations are introduced to each simulation (as described below), in order to assess the distribution of frequency, amplitude and, where calculated, phase errors for each method. The well-known Root Mean Square Error (RMSE), calculated across all 20,000 simulations, is used to evaluate the measurement performance of each parameter for the given noise level.
For each individual simulation, certain parameters values are chosen from random distributions. Firstly, the particular frequency of each signal component is selected using the following procedure. Given the approximate frequency of each component listed in Table 1, the nearest exact frequency is calculated such that δ=0. Centred on that frequency, a range of frequencies is defined such that δ is in the range [−0.5, 0.5]. In this case, with the sampling rate fs=1000 Hz, and the data set length 3926 samples, this corresponds to a frequency range of i 0.127 Hz. For each simulation, the exact frequency of each component is selected from a uniform random distribution with this range, so that the corresponding value of 6 is randomly selected within the range [−0.5, 0.5]. As this procedure constitutes only a minor variation from each of the frequencies listed in Table 1, these approximate values remain convenient labels for discussing the local distribution of frequencies used across all simulations. Secondly, the initial phase of each signal component is randomly selected from the range [−π, +π], to ensure that results are not affected by any fixed phase relations between components. Finally, random white noise is generated independently for each simulation and added to the signal components to form the time series for analysis.
As stated above, the FFT does not identify spectral peaks, but calculates magnitudes/amplitudes along with other parameter values at regularly space frequency intervals. As cited in [4], a variety of techniques have been developed for improving peak estimation based on FFT data, however, there may be no generally accepted solution that is widely practiced across all applications. Here, in order to evaluate the performance of the FFT calculation itself, the FFT frequency value closest to the true component frequency (which varies randomly so that δ e [−0.5, 0.5]) is selected as the ‘peak’ value, together with its reported amplitude.
The main characteristic of
The results for the smaller amplitudes illustrate the problem of hidden peaks. It can be seen in
In summary, the application of the Hann window and FFT to determine peak frequency and amplitude values for sets of signals based around the components of Table 1 has demonstrated the significant influence of the (by default unknown) 6 parameter on the resulting error, along with, for smaller peak amplitudes, the impact of spectral leakage.
There follows a description and demonstration of how the Prism-based four convolution (P4C) technique, i.e. using the method 600, may be applied to the same simulation examples. This typically results in substantially reduced frequency and amplitude errors. There are at least two significant advantages of the new technique over current state-of-the-art FFT calculations. The first advantage is the suppression of spectral leakage by the stopband attenuation of a multi-layer Prism low pass filter. The second advantage is that the use of four convolutions together with the calculations of equations (9)-(13), result in a direct calculation of the frequency of a local peak, so that the true peak frequency and amplitude can be calculated, thus significantly reducing the errors associated with δ. Furthermore, in another instantiation, it is possible to combine P4C with the basic FFT procedure in order to advantageously obtain both the accuracy of P4C and the computational efficiency of FFT. In preferred examples, the FFT technique can be used in combination with only two of the four convolution functions.
In order to demonstrate application of the P4C technique of method 600 to the example specified in Table 1, the following example Prism characteristics are employed. Given the sample rate fc=1000 Hz, the selected value of m for the low pass filter is m=fc/160=6.25 Hz. The low pass filter peak is at approximately 0.4 m=2.5 Hz. With 160 samples per Prism integral length, (and recalling that each Prism consists of two consecutive integral stages), the 12 layer low pass filter has a nominal length of 3840 samples. The tracker Prisms employ m=5 Hz, so that r=0.5 at 2.5 Hz, close to the low pass filter peak frequency. Accordingly, the parallel Prism trackers have a length of 2×200 samples, so that the total length of the signal processing network formed from the concatenation of low pass filter and tracker (as illustrated in
As described above, the P4C calculation, absent any additional pre-processing, has the following effect on data sets generated to the specification of Table 1. All frequency components falling outside the range 0-m Hz will be attenuated by at least −313 dB, while the peak frequency occurring within this range will be calculated, along with its phase and amplitude. Given the peak frequencies listed in Table 1, all of these components fall outside of the passband range 0-m Hz and so will be attenuated, while the reported values of frequency phase and amplitude will be based on the noise characteristics falling within the passband. Accordingly, further processing steps are required to apply the P4C technique to provide a form of spectral analysis whereby all frequency components are detected. As outlined in [4], one means of achieving this is to use heterodyning to ‘shift’ a target frequency into the passband region of the P4C calculation. The systematic application of heterodyning over a range of frequencies, followed by the application of P4C to each heterodyned data set, may therefore be used to provide a useful spectral analysis of a data set, as outlined below.
Thus, in some examples of method 600, four convolutional filters are provided in step 601, each convolutional filter of the four convolutional filters generated using examples of method 400 which result in the convolutional filters providing a respective one of the outputs Gc1, Gs1, Gc2 and Gs2. Step 602 of applying each of the four convolutional filters then comprises heterodyning the input signal using a plurality of heterodyne frequencies selected based on a pass-band of the low-pass or band-pass Prism filter. In other words, multiple heterodyne steps are used to move all frequency components of the input signal into the pass-band of the convolutional filters. Each of the four convolutional filters is applied to the heterodyned input signal for each heterodyne frequency to generate the outputs Gc1, Gs1, Gc2, and Gs2 for each heterodyne frequency. Step 603 of generating an output indicative of a parameter of the input signal (e.g. amplitude, phase, and/or frequency) then comprises generating the indicative output of the heterodyned input signal for each heterodyne frequency based on the outputs Gc1, Gs1, Gc2, and Gs2 generated for that heterodyne frequency.
As noted further below, further advantages can be achieved by using the FFT calculation itself as a means of providing systematic heterodyning, when suitably combined with P4C or a subset thereof.
Heterodyning is a technique, well known to those familiar with the art, used as a means of applying a frequency shift to a signal. In one instantiation, heterodyning is applied to a sinusoid of frequency f1 in order to effect a shift to frequency f2 by means of multiplication by a sinusoid of frequency fh=f1−f2. Given the original signal, s(t):
A heterodyning signal h(t) may be constructed:
such that the product term p(t) has a component at the desired frequency f2:
Heterodyning introduces a number of additional signal properties, which may be taken into account during subsequent signal processing, for example the following. A second sinusoidal term is generated with frequency (fh+f1). In some examples, this term may be filtered out, for example by the application of a filter with low stopband attenuation. The amplitude of the signal at the desired frequency, f2, is only half that of the original signal, which is readily compensated. A further change is that a π/2 phase shift is introduced, indicated by the substitution of sine with cosine between Equations (14) and (16). More detailed consideration of the phase relationships between the original [s(t)], heterodyning [h(t)], and product signal [p(t)], are well understood by those familiar with the art, so that, for example, it is possible to recover the phase of the original signal if the phase of the heterodyning signal and that of the desired f2 term in the product signal are known or calculated.
The procedure of
However, an alternative and more efficient instantiation of P4C spectral analysis reformulates the calculation to take advantage of the computational efficiency of the FFT. As stated above in the quotation from [4], for a data set of length N samples, the FFT calculation has computational cost of order N log(N). By contrast the procedure of
Given the earlier descriptions of convolution (e.g. Eqn. 8), and of heterodyning (Eqn. 16), it is readily seen that, in
where xi is the ith value in the data set, hij is the eth value of the heterodyning signal for the jth target frequency, and ci is the ith value in the convolutional filter value for Gs1. Equivalent calculations are used for Gc1, Gs2, and Gc2, where the only change is the convolution filter applied. Note that the product xi. ci is unchanged for all target frequencies. This suggests an alternative formulation, where the convolutional filters for Gs1 and the other functions are treated as window functions for the data set. Thus:
where Equation 18 is equivalent to applying the Gs1 convolutional filter as a windowing function to the data set, and equation 19 describes a set of regularly spaced DFT calculations applied to the product set, which can be implemented efficiently using the FFT algorithm, provided as the imaginary components (the “sine” terms) of the FFT result.
Accordingly, in some examples of method 600, step 602 further comprises applying a Fourier transform algorithm (e.g. FFT algorithm) to the output of each convolutional filter of the two or more convolutional filters to generate the outputs Gc1, Gs1, Gc2, and Gs2. This process can use all four of the G4C convolutional filters. Advantageously, however, the properties of the Fourier transform can be used to generate the functional equivalent of all four outputs Gc1, Gs1, Gc2, and Gs2 from just two convolutional filters. In particular, only two sine convolutional filters may be used; or only the two cosine convolutional filters may be used.
This concept is illustrated in
The Gs1 spectrum in
This frequency offset also explains the double peak characteristic in
After the four FFT results have been calculated for each of the windowing functions Gs1, Gc1, Gs2, Gc2, the values of amplitude and r may be calculated for each interrogation frequency value, using equations 9-12.
where fest is the estimated true peak frequency, and fh is the heterodyning frequency used for the current interrogation frequency.
It can be seen that for any interrogation frequency where the 240 Hz peak, after heterodyning, falls within the passband of the P4C method, the peak frequency is estimated well (errors<1e−3 Hz), with very low errors (˜1e−10 Hz) where the interrogation frequency is very close to the true peak, which is also associated with an r value close to 0.5 (
The capability of the P4C method to accurately estimate the true peak frequency over a reasonably wide range of interrogation frequencies, provides a significant advantage over state-of-the-art FFT techniques. This is coupled with the high attenuation of all signal components not within the heterodyned passband, to minimize spectral leakage and its associated errors.
In the second stage of the P4C method, candidate peak frequencies may be identified, based on the sweep values obtained in the first stage. Selection criteria may include an amplitude threshold, whether a peak has been identified as positive or negative (to avoiding duplicating peaks), and whether it has an r value close to 0.5 (where the filter has been designed to provide the optimal value of r=0.5, as described above). For example, in
Where there is very low noise, it is possible for false peak pairs to arise, from ‘echoes’ of large peaks. This is illustrated in
Having identified a set of estimated peak frequencies, a third stage may obtain refined results by repeating the P4C process, targeting only the estimated frequencies. This should ensure accurate estimates of amplitude and phase are obtained.
Accordingly, method 400 may further comprise the steps following steps (i) to (iii).
The final output of the P4C process may therefore be a list of peak frequencies (i.e. frequencies of peaks in the input signal), amplitudes and/or phases, together with other parameters extracted from the calculation, for example an estimate of the noise floor based on amplitude values remote from any peak. The final result may be represented graphically as shown in
Yet simpler and preferred examples, which have reduced computational requirements but may generate equivalent numerical results to P4C+FFT, are as follows. As is well known to those familiar to the art, a typical FFT computation will generate both real and imaginary components, corresponding to cosine and sine Discrete Fourier Transforms respectively, from which, for example amplitude and phase estimates can be derived. In the method of
for discrete timesteps ti corresponding to the sample points in the data window.
These heterodyne signals are convoluted with the Gs1 product window:
The amplitude A1 is given by the root-sum-square of z, and zc while the phase is calculated from the arctangent of their ratio. A similar calculation using the Gs2 product window yields the value of A2.
The simulation study generating the FFT results shown in
The performance of the P2C method for this example can be summarized as follows: unlike the conventional FFT methods, the technique shows little or no error sensitivity to small variations in frequency. The primary source of error is the signal to noise ratio, as measured for example by the ratio between the true peak amplitude and the white noise standard deviation. For high signal-to-noise ratios, very low RMSEs are achieved for frequency, phase and amplitude estimates. In some cases, for the same simulated conditions, the Han-FFT RMSE for amplitude and/or frequency is more than one billion times larger than the corresponding P2C-FFT RMSE.
A very similar pattern is observed for the RMSE for phase, shown in
Accordingly the P2C method has demonstrated substantial error reduction compared to the conventional Hann-FFT technique, for limited additional computation: principally two windowed FFT calculations are performed with P2C instead of one for Hann-FFT.
As well understood by those familiar with the art, there is a general tradeoff, in the design and implementation of filtering and tracking systems, between achieving good noise suppression, for example through narrowband filtering, and successfully tracking dynamic change in the signal component of interest, for example a rapid step in amplitude or frequency. The issue may arise, for example, when monitoring a resonant sensor, such as a Coriolis mass flow meter, which generally produces signals with stable amplitude and frequency characteristics, but which during transitions (for example draining or filling of the sensor with liquid) may exhibit rapid changes in both amplitude and frequency. A filter which is strong enough to suppress noise may generate significant errors in frequency, amplitude or phase calculations during fast dynamic change of the true signal. Accordingly, a new technique is disclosed which uses the simple and robust FIR Prism structure to track rapid dynamic change using means that are model free, which avoid feedback, and which are generally numerically stable. The assumption here is that there is a single signal component, typically with a known and limited range of frequency and/or amplitude variation, which is to be tracked.
Method 700 starts at step 701, at which the input signal the input signal s(t) is input into the first tracker 801. The first tracker 801 is configured to determine a first estimate of the characteristics of the input signal s(t). The first estimate comprises a first amplitude estimate and/or a first frequency estimate. The first tracker 801 is a Prism-based tracker. That is, the tracker 801 may comprise and/or be derived from one or more Prism filters, such as Prism 100. The first tracker 801 may include a filtering component, such as a low pass filter, in combination with a tracking component. As such, first tracker 801 may comprise any of the examples of filter system 500. Alternatively tracker 801 may consist only of a tracker component, without a separate filtering stage. In general tracker 801 may comprise or be derived from any of the filters described herein. In particular, tracker 801 (or a filtering component thereof) may be or be derived from any example of the filter system 200. Tracker 801 (or a filtering component thereof) may be convolutional filter derived from a Prism filter or Prism filter network. The convolutional filter may be generated using any example of method 400. Where the tracker 801 is a convolutional filter, the convolutional filter outputs the first estimate (or the ‘G’ values that can be used to calculate estimates of the characteristics using the equations discussed above). As such, inputting the input signal into the first tracker 801 may comprise performing any example of method 600 discussed above. In alternative examples only a filtering component of tracker 801 is a convolutional filter. In such cases the tracker component is an instantiation of one or more Prism filters 100 arranged to generate the ‘G’ outputs discussed above.
In general, the first tracker 801 has relatively fast dynamics (i.e it is a wide pass band). The first tracker 801 establishes an approximate amplitude and/or frequency of the desired component within the input signal.
Once the first estimate of characteristics has been determined, the method 700 moves on to step 702. At step 702, a normalised signal is determined from the input signal. The aim of step 702 is to reduce the dynamic variation of the component in the original input signal.
In some examples, the normalised signal is determined by normalising the amplitude of the input signal using the first amplitude estimate. For example, each sample of the original signal is divided by the estimated component amplitude for that sample from the first stage tracker (allowing for fixed delay, avoiding division by zero, and applying other safeguards as well known to those familiar with the art). This may result in significantly reduced amplitude variation for the signal component supplied to the second tracker 802, as the nominal amplitude is 1.0, so that deviations from 1.0 in the amplitude estimated by the second tracker 802 (discussed below) may acts as corrections to the first stage amplitude estimate, arising from improved noise filtering and/or reduced amplitude dynamics. Where convenient, an alternative value to 1.0 may be used as the nominal amplitude.
Alternatively or additionally, determining the normalised signal may comprise heterodyning the input signal s(t) using a heterodyne frequency determined based on a sum and/or difference between the first frequency estimate and a filter frequency. The filter frequency is a frequency in the passband of the second tracker 802. For example the filter frequency may be the centre of the passband, or the frequency at which the signal attenuation induced by the second tracker 802 is a minimum. Here, the original input signal is heterodyned to match a desired frequency. The heterodyning frequency can be varied sample by sample based on the frequency estimate from the first stage (assuming a respective first frequency estimate is determined for each sample in the input signal, after an initial delay due to the length of the first tracker 801). As such, the heterodyning may be considered a dynamic heterodyning. As a consequence, the second tracker 802 may receive a signal where the component to be tracked has reduced frequency variation. Once the normalised signal is determined, the method 700 proceeds step 703. At step 703, the normalised signal is input into the second tracker 802 to determine a second estimate of characteristics of the input signal. The second tracker 802 is configured to pass a narrower range of frequencies than the first tracker 801. As such, the second tracker 802 rejects more noise than the first tracker 801.
The second tracker 802 is a Prism-based tracker, similarly to first tracker 801. Any of the examples of Prism filter discussed above with respect to first tracker 801 may be used as the second tracker 802. In particular examples, the form of the network of Prism filters of which the second tracker 802 comprises or is derived is the same as that of the first tracker 801. Thus, for example, both trackers 801, 802 may comprise or be derived from networks of Prism filters with the same number of cosine sets and sine sets, and/or the same number of cosine/sine Prisms in the cosine/sine sets. As will be appreciated from the discussion of Prism filter 100 above, the different passband widths of the first tracker 801 and second tracker 802 can be set by the their respective values of characteristic frequency, m. The characteristic frequency m1 of the first tracker 801 is larger than the characteristic frequency m2 of the second tracker 802. In particular examples, the value of m is at least 1.5 times, or at least 10 times, or at least 20 times, or at least 50 times, or at least 100 times smaller than the value of m1. The absolute value of m1 and m2 (or generally the characteristic frequency used in any example) will depend on the nature of the input signal. In some examples herein, the value of the characteristic frequency or frequencies may be in the range 0.01 Hz to 200 MHz.
The outputs of the second tracker 802, providing characteristic information of the normalised signal, can be used to generate the second estimates of the characteristics of the input signal. For example, the second estimates may be derived from the outputs of the second tracker 802 based on the amplitudes and/or heterodyne frequencies used to generate the normalised signal. Alternatively, the outputs of the second tracker 802 can be combined with the first estimates to derive the second estimates. Accordingly, the second tracker 802 amplitude estimate may be combined with the first amplitude estimate to give a best estimate for the original input signal, for example by calculating the product of the amplitude estimates from the first and second trackers 801, 802, while accounting for the respective digital delays in each tracker 801, 802. The frequency and phase estimated by the second tracker 802 may be combined with the recorded heterodyning frequency and phases (compensated for time delay) to generate improved estimates of the phase and frequency of the original signal.
The amplitude and/or frequency normalisation at step 702 are preferably performed on each of a plurality of samples in the input signal. In particular, the normalisations are preferably performed on each and every sample in the input signal, except for an initial set of samples for which no first estimates are generated due to the length of the first tracker. In other words, there is a delay between the start of the input signal, and the time at which normalised signals begin to be generated. In general two sorts of delay are possible: the calculation delay; and the response delay. Assume that the compute engine is powerful enough for the arithmetic to cause negligible additional delay compared to the time between each received sample. Then, the calculation delay for any Prism structure is simply its total length times the period between each sample, i.e. the total duration of the (entire) data window. If the Prism structure include a tracker as the final stage, then freq/amp/phase values are calculated. These values correspond in time to the midpoint of the data window, as they are linear time averages. Accordingly, in the arrangement shown in
Thereafter, the first tracker 801 produces a new estimate every sample, and the second tracker 802 receives a new sample, whereby the first amplitude/frequency estimates used in the normalised signal provided to the second tracker 802 are the latest outputs from the first tracker 801, but the corresponding raw data is 100 samples behind.
The combination of amplitude normalisation and dynamic frequency heterodyning can be termed “I40”, referencing Isaiah Chapter 40-“Every valley shall be lifted up, and every mountain shall be made low”—as this describes the transformations applied between the first tracker 801 the second tracker 802 in order to facilitate improved signal tracking. This technique is simple, requires no modelling or feedback, and may deliver good tracking of dynamically varying signals.
Two Prism based trackers are used to generate results, each consisting of a 6 layer low-pass filtering component of the type illustrated in
Results for three different tracking strategies are illustrated in
The method 700 may be implemented in a variety of ways. As noted above tracker 801, 802 may simply be a tracking Prism or Prism pair, (which may provide a measure of lowpass filtering) with associated frequency, amplitude, and/or phase calculations; or it may include a pre-filter (i.e. a filtering component) taking the form of any of the several Prism techniques and implementations previously described, or prior art conventional FIR filters, whether in Prism or convolutional instantiation. Although described above as comprising a first tracking stage and a second tracking stage, with corresponding first and second trackers 801, 802, other examples of method 700 may use additional tracking stages/trackers. In such examples, the processes of dynamic heterodyning and/or amplitude normalization are applied to after each tracking step, based upon the most recent amplitude and frequency estimates for the original input signal, and where each tracking step provides a narrower passband to facilitate improved noise reduction.
Ultra-Narrowband Filtering with Downsampling
The prior art [B, 2] has described the instantiation of ultra-narrowband Prism-based filters, for example using a six-Prism bandpass filter design. This potentially very long filter design using a small number of Prisms may deliver powerful narrowband filtering performance for significantly lower computational cost than would be possible for the equivalent conventional convolutional filter design. For example, reference [2] describes the implementation of a bandpass filter with 20 MHz sampling and a passband of only 0.01 Hz, resulting in a filter length of approximately 3.9 billion samples, which yet requires only 300 flops per sample to update the filter, a speed-up over an equivalent conventional convolutional filter by a factor of approximately 25 million. Nevertheless, this approach retains certain disadvantages, including the requirement for a large computer memory to store the Prism filter coefficients and data windows. Given that this filter has a step response time of approximately 190 s, the provision of filter outputs at the full sample rate of 20 MHz may be considered excessive, as it will require computational overhead to deal with each new tracker result.
The novel techniques described in this disclosure provide alternative means of achieving ultra-narrowband filtering which may provide one or more of the following benefits over the prior art: improved filtering performance (e.g. lower stopband attenuation), significantly reduced computer memory requirements, reduced update rates (e.g. appropriately matching the response time of the filter), and real-time adjustment to track the desired signal component.
The novel techniques enabling these advantageous features arise in part from the previously described properties of a convolutional implementation of a Prism filter. Firstly, the convolutional calculation may be applied to any contiguous set of samples of appropriate length, without the requirement that it be applied each time the input time series is updated with a new sample. Secondly, the memory storage requirement may be significantly reduced, as only the filter coefficients and one or a small number of accumulators may be needed. Accordingly, the convolutional form of Prism filter is readily combined with the well-established technique of downsampling, to create multi-staged, ultra-narrowband filtering which may provide some or all of the additional benefits described above.
The method 900, as illustrated in
Applying each respective filter stage 1001, 1002 in step 901 comprises firstly heterodyning the input for the respective filter stage 1001, 1002 based on a respective target frequency and a respective filter frequency for that filter stage 1001, 1002; and secondly applying a respective convolutional filter to the respective heterodyned signal. The process of applying the filter stage(s) 1001, 1002 to the input signal in step 901 is illustrated in
The illustrated example of step 901 starts with steps 911 and 912. These steps correspond to applying the first filter stage 1001. At step 911, the input signal (which is the respective input of the first stage 1001) is heterodyned based on a first target frequency and a first filter frequency. The first filter frequency is a frequency that a first convolutional filter of the first filter stage 1001 is configured to pass. For example it may be a peak frequency of the first convolution filter. The first target frequency is a target frequency of the input signal. The target frequency of the input signal is an expected or estimated frequency of a component in the input signal. The aim of the heterodyning step is to shift the respective target frequency towards the peak of the respective convolutional filter of that filter stage 1001, 1002.
The method then proceeds to step 912, at which the heterodyned input signal is input into the first convolutional filter of the first filter stage 1001. The first convolutional filter is applied to a subset of the samples of the heterodyned input signal. The subset of samples is based on a first downsampling factor of the first filter stage 1001. For example, if the downsampling factor is 1000, the first filter is applied to every 1000′ sample of the heterodyned input signal. The outputs of the applications of the first filter form a first downsampled signal. The sampling rate of the downsampled signal will be the sample rate of the input signal divided by the downsampling factor. The first downsampled signal is the output of the first filter stage 1001.
In examples of method 900 comprising only one filter stage 1001, method immediately proceeds to step 902. In step 902 of such examples, the first downsampled signal is passed to the tracker stage 1003. Step 902 is described in further detail below.
In the illustrated example of method 900, however, there are two filter stages 1001, 1002. In such cases, the method 900 comprises applying a second filter stage 1002 before proceeding to step 902. Thus in the illustrated example, the method proceeds from step 912 to steps 913 and 914. Steps 913 and 914 correspond to applying the second filter stage 1002.
The second filter stage 1002 receives the first downsampled signal as an input. In step 913, the first downsampled signal (i.e. the respective input of the second filter stage 1002) is heterodyned based on a second target frequency and a second filter frequency. The second filter frequency is a frequency which a second convolutional filter of the second filter stage 1002 is configured to pass. For example it may be the peak frequency of the second convolutional filter. The second target frequency is the equivalent of the first target frequency (i.e. the actual target frequency of the input signal), as frequency shifted by the first heterodyning step 911. The second convolutional filter may take any of the forms discussed above in relation to the first convolutional filter, but configured to filter lower frequencies. In preferred examples, the respective convolutional filters of the first and second filter stages 1001, 1002 (and any other filter stages) are derived from respective networks of Prism filters having the same form but different characteristic frequencies, m.
The heterodyned signal generated by step 913 is then used in step 914. In step 914, the second convolutional filter is applied to a subset of the samples of the output of step 913. The subset of samples is based on a second downsampling factor of the second filter stage 1002. For example, if the second downsampling factor is 1000, the second filter is applied to every 1000th sample of the heterodyned respective input signal of the second filter stage 1002. The outputs of the applications of the second filter form a second downsampled signal.
In examples of method 900 comprising only two filter stages 1001, 1002, the method then proceeds to step 902. In step 902 of such examples, the second downsampled signal is passed to the tracker stage 1003. Step 902 is described in further detail below.
In general, however, any number of filter stages 1001, 1002 may be applied. Where more than two filter stages 1001, 1002 are used, step 901 of method 900 further comprises applying each additional filter stage in turn after step 914. Each additional application of a filter stage 1001, 1002 is similar to the application of the second filter stage 1002 discussed above, but with respective parameters. Each additional filter stages receives as an input the output of the preceding stage in the sequence of filter stages 1001, 1002. Thus a third filter stage would receive as an input the second downsampled signal generated in step 914, and would perform heterodyning and filtering steps on that respective input. Each additional filter stage may apply a respective heterodyning step to the respective input it receives. The respective heterodyning step is based on a respective filter frequency and respective target frequency. The respective filter frequency is a filter frequency which a respective convolutional filter of that filter stage is configured to pass. The respective target frequency will be the equivalent of the target frequency of the input for the heterodyned frequency range received by that respective filter stage. This will be more apparent with the example discussed below in relation to
Once all the filter steps 1001, 1002 have been applied, the method 900 proceeds to step 902. At step 902, a tracker stage 1003 is applied to the output of the final filter stage 1001, 1002. That is, downsampled signal generated by the final filter stage 1001, 1002 is used as the input to the tracker stage 1003. In the example illustrated in
Applying the tracker stage in step 902 comprises firstly heterodyning the downsampled signal generated by the final filter stage based on a tracker target frequency and a tracker filter frequency. The tracker filter frequency is a frequency which the tracker filter is configured to pass, such as a peak of the tracker filter. The tracker target frequency is an estimated frequency of the component of the input signal to be tracked, as shifted into the frequency range of the final convolutional filter in the sequence of filter stages 1001, 1002. As discussed further below, the tracker target frequency may be estimated based on the original estimated component frequency of the input signal. Advantageously, however, the tracker target frequency in some examples is estimated using the method 700.
Once the input to the tracker stage 1003 has been heterodyned, the tracker filter is applied to the heterodyned signal to determine one or more characteristics of the input signal. The tracker filter may directly output the characteristics, such as frequency, amplitude, and/or phase, or it may generate the ‘G’ values discussed above from which the characteristics can be calculated. In the filter system 1000 illustrated in
In the implementation of
In outline this multistage filter behaves as follows. The first filter stage 1001 applies heterodyning to shift the target frequency of the input signal (10 MHz in this example) towards the peak of a first convolutional low pass Prism filter. The filter is applied to the time series at the downsampling rate (i.e. 1000 in this example). As the downsampling rate between the first filter stage 1001 and the second filter stage 1002 is 1000 (50 MHz to 50 kHz), the convolutional filter is applied to the 50 MHz input signal time series once every 1000 samples, generating a downsampled and filtered result which forms a value in the time series input to the second filter stage 1002. The second filter stage 1002 repeats the calculation of the first filter stage 1001, thereby downsampling from 50 kHz to 50 Hz. In the illustrated example, the second filter stage 1002 also performs in parallel a convolutional version of the filter and tracking calculation of method 700, described above, to provide an estimate of the current amplitude and frequency for each value in the second filter stage 1002 output time series. This may facilitate the use in the tracker stage 1003 of dynamic heterodyning and/or amplitude normalization, as utilized in the ‘I40’ process of method 700 described above. In the tracker stage 1003, a conventional Prism instantiation of a final stage of filtering and tracking is used to provide estimates of frequency, amplitude and/or phase of every sample at the rate of 50 Hz. Compensation for the higher level heterodyning may be used to calculate the corresponding parameter values for the original 50 MHz input signal.
To further illustrate this filter design, exemplary parameter values and operational details are provided, including results from example calculations. Assuming the input signal has a target frequency of 10 MHz, the following design might be applied in the first filter stage 1001. Thus the first target frequency of the first filter stage 1001 is 10 MHz. As will be demonstrated, a 5:1 ratio between a respective target frequency and sampling rate of a respective output may be sufficient to deliver good tracking performance. Thus with a first filter stage 1001 output sample rate of 50 kHz, a suitable first convolutional filter design may use a peak frequency of 10 kHz. This is the first filter frequency of the first filter stage 1001. Accordingly, a heterodyning frequency of 9.99 MHz may be applied to shift the first target frequency of 10 MHz to the first filter frequency of 10 kHz. In general, for any respective filter stage, a ratio of a sample rate of the respective downsampled signal generated in the filter stage and the respective filter frequency may be between 2:1 and 10:1, or between 3:1 and 7:1, or between 4:1 and 6:1, or is (or is approximately) 5:1. Conventional tracking techniques tend to use larger ratios. Using the smaller ratios presented here reduces the computational requirement of the tracking.
A six layer low pass Prism filter, as illustrated in
The first filter stage 1001 operation in this example is as follows. Heterodyning is applied at 9.99 MHz to the input signal. Once in every thousand samples, the first convolution filter is applied to a data window consisting of the most recent 23742 samples in order to generate the next single value in the output time series. The resulting hetrerodyned, filtered and downsampled signal will have the original peak of approximately 10 MHz shifted to approximately 10 kHz, and a sample rate of 50 kHz.
Given the length of the filter compared to the downsampling rate, each 50 MHz sample will be used in either 23 or 24 convolutional calculations of a 50 kHz Stage 1 output value. The corresponding computational cost per sample (allowing for one multiply and accumulate per convolution) is therefore less than 50 flops per 50 MHz sample. Those familiar with the art will be aware that fixed frequency heterodyning can be achieved efficiently through a variety of means, including for example a pre-computed table of heterodyne values that are recycled, so that the overall cost of the first filter stage 1001 calculation may be of the order of 50 flops per sample, compared with the 300 flops per sample cost of the prior art Prism bandpass design [2]. The second filter stage 1002 and tracker stage 1003 computational costs, described in detail below, are significantly smaller, as their sample rates are reduced by factors of 1,000 and 1,000,000 respectively, so that overall the computational requirement for this design is approximately six times less than that for the prior art Prism-based bandpass design, which itself is substantially reduced ([2]) compared with conventional FIR techniques. In addition, the storage requirement for the first filter stage 1001 is significantly reduced compared to the Prism design in [2]; in the first filter stage 1001, the ˜24k filter coefficients and 24 accumulators must be stored, together with the storage associated with the heterodyning calculation, whereas the bandpass filter design described in [2] may require several Gbytes of memory.
As shown in
The six layer low pass Prism filter design applied in the first filter stage 1002 may also be used in path (A) of second filter stage 1002, in this case applied to a time series with sample rate of 50 kHz and a filter peak frequency of 10 Hz. The value of m selected is 25 Hz, providing a peak at 0.4m (i.e. at 10 Hz), a passband width of approximately 4.6 Hz centred at 10 Hz, and stop-band attenuation (for frequencies above m i.e. 25 Hz) of −156 dB. If the convolutional filter designs used in first and second filter stages 1001, 1002 are the same, other than the reduced sample rate in the second filter stage 1002, then the filter coefficients may be identical, enabling further memory efficiency.
In path (B) of the second filter stage 1002, and in parallel with path (A), a filtering and tracking calculation, as illustrated for example in
In a preferred example, the low pass filter design in path B of the second filter stage 1002 is identical to that used in path (A), so that the amplitude and frequency estimates in path (B) correspond exactly to the filter outputs from path (A). However with the additional tracker components included in the convolutional filters, as illustrated in
The data storage requirements for the illustrated second filter stage 1002 are larger than for the first filter stage 1001. Even if the low pass filter used in path (A) of the second filter stage 1002 is identical of that of the first filter stage 1001, the filter coefficients of the 4 convolutions in path (B) must also be stored, so that including the first and second filter stage 1001, 1002 the total storage requirements may be approximately one hundred and forty thousand values. The computational requirement for the second filter stage 1002 may be larger per sample than for the first filter stage 1001, but with the sampling rate reduced by a factor of 1000, the second filter stage 1002 may not significantly increase the overall computational burden.
After the filtering stages 1001, 1002, the method moves to applying the tracker stage 1003. In the illustrated example, samples are supplied to the tracker stage 1003 at a reduced sample rate of only 50 Hz whereby final frequency, amplitude and/or phase estimates may be calculated every sample. Accordingly, a conventional recursive Prism calculation may be instantiated to provide the final level of low pass filtering and tracking. According to application requirements and the signal properties, it may be advantageous to apply dynamic heterodyning and/or amplitude normalization to the input received by the tracker stage 1003, based on the amplitude and frequency estimates received from the second (or more generally final) filter stage 1002, as previously described in relation to method 700. Alternatively, the amplitude and/or frequency estimates generated by the illustrated second filter stage 1002 may be used to perform basic quality assurance and range checking before the final application of heterodyning, low pass filtering and tracking. This facilitates the ability to check that the input signal falls inside the range of the narrowest filter band, and/or to adjust the heterodyning frequency accordingly.
Without further downsampling to consider, the choice of tracker stage 1003 parameters is primarily a tradeoff between dynamic response and noise reduction. For example, the tracker stage 1003 processing may use the same 6 layer low pass filter structure as the first and second filter stages 1001, 1002, but using m=0.15625 Hz, resulting in a peak frequency of 0.0625 Hz and a heterodyning frequency of 9.9375 Hz. The resulting low pass filter+tracking structure may have a total length of 5557 samples, which, operating at 50 Hz, corresponds to a total duration of approximately 112 seconds.
Frequency, amplitude and/or phase values generated as outputs to the tracker stage 1003 may have compensation applied for each of the earlier stages of heterodyning, so that estimates of the parameters of the original 50 MHz time series may be calculated.
As tracker stage 1003 operates at only 50 Hz, its contribution to the overall computational burden is negligible. However, the storage requirements for the full Prism instantiation of tracker Stage 1003 may be high, for example approximately 300,000 values. Overall, therefore the computational requirements of the
Any of the filters and filter systems used herein, the filters generated by the methods disclosed herein, and the methods of using filters disclosed herein are configured and/or used to filter input signals representing physical quantities or entities. This includes any example of filter system 200; any example of method 300; any example of method 400; any example of filter system 500; and any example of method 600. For example the input signal may be (or represent) a signal measured by a physical sensor or other physical instrument measuring a physical parameter.
In any of these examples, the input signal may be, or may be a representation of, an audio signal, video signal, communications signal, system control signal, seismological signal, biological signal, electrical power signal, radar signal, sonar signal, or signal representing measurements (or directly may be measurements) of physical quantities measured by a scientific or industrial instrument. The input signal may represent measurements of a mechanical or electrical system. The input signal may be the output of a measurement device configured to measure a mechanical or electrical system. The methods/filters discussed above may be incorporated into such a measurement device.
In particular examples, any of the filter/filter systems/methods may be for filtering signals from a Coriolis meter. A Coriolis meter may comprise a filter/filter system according to any of the examples here, for example as a dedicated hardware filter block arranged to receive and filter an input signal. The Coriolis meter may be configured to perform any of the methods disclosed herein.
In particular examples, any of the filter/filter systems/methods may be for filtering for filtering signals representative of medical images.
In particular examples, any of the filter/filter systems/methods may be for filtering for filtering biological signals.
In particular examples, any of the filter/filter systems/methods may be for filtering for filtering neural signals.
In particular examples, any of the filter/filter systems/methods may be for filtering for filtering communications signals or audio signals.
In particular examples, any of the filter/filter systems/methods may be for vibration monitoring and/or condition monitoring of a mechanical or electrical system.
The term ‘block,’ ‘stage block,’ ‘integration stage block’ or ‘signal processing block’ may be used throughout these disclosures to indicate some means of performing a numerical calculation, whether by hardware, software, or other means. The term is not meant to imply any restriction in the computational architecture, methodology or instantiation; it is simply a convenient label to identify and discuss the various method or system steps presented in this disclosure.
The various illustrative logical blocks, modules, and processes described herein may be implemented or performed by a machine, such as a computer, a processor, a digital signal processor (DSP), a graphics processing unit (GPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A processor may be a microprocessor, a controller, microcontroller, state machine, combinations of the same, or the like. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors or processor cores, one or more graphics or stream processors, one or more microprocessors in conjunction with a DSP, or any other such configuration.
Any of the filters and filter systems used herein, the filters generated by the methods disclosed herein, and the methods of using filters disclosed herein may (including any example of filter system 200; any example of method 300; any example of method 400; any example of filter system 500; and any example of method 600) be implemented on a computer, or implemented on a computer readable medium, such as a non-tangible computer readable medium, or may implemented as a computer program. Any of the filters and filter systems used herein, the filters generated by the methods disclosed herein, and the methods of using filters disclosed herein (including any example of filter system 200; any example of method 300; any example of method 400; any example of filter system 500; and any example of method 600) may be implemented in a dedicated hardware filter block, configured for the sole-purpose of implanting the filter/s and filtering input signals. For example, the filter block may comprise a processor and a memory. The memory stores instructions which, when executed, cause the processor to perform any of the methods described above. Additionally or alternatively, the memory may store properties or coefficients of the filter or filter system, so that the filter or filter system can be instantiated on the processor to filter a received input signal. The filter block further comprise an output to output the filtered signal. The dedicated filter hardware block may be a standalone product, or may be incorporated into device, such as a sensor device. For example, the dedicated filter hardware block may be incorporated into a Coriolis meter.
In particular, certain implementations of the Prism-based filter/filter systems of the present disclosure are sufficiently mathematically, computationally, or technically complex that application-specific hardware (e.g., FPGAs or ASICs) or one or more physical computing devices (utilizing appropriate executable instructions) may be necessary to perform the functionality, for example, due to the volume or complexity of the calculations involved (e.g., filtering and tracking a signal in a low signal-to-noise environment) or to provide results (e.g., tracked signal) substantially in real-time.
The blocks or states of the processes described herein may be embodied directly in hardware, in a software module stored in a non-transitory memory and executed by a hardware processor, or in a combination of the two. For example, the filters/filter systems or methods may also be embodied in, and fully automated by, software modules (e.g. stored in a non-transitory memory) executed by one or more machines such as computers or computer processors. A module may reside in a computer readable medium such as RAM, flash memory, ROM, EPROM, EEPROM, registers, hard disk, an optical disc, memory capable of storing firmware, or any other form of computer-readable (e.g., storage) medium. A computer-readable medium can be coupled to a processor such that the processor can read information from, and write information to, the computer-readable medium. In the alternative, the computer-readable medium may be integral to the processor. The processor and the computer-readable medium may reside in an ASIC. The computer-readable medium may include non-transitory data storage (e.g., a hard disk, non-volatile memory, etc.).
The processes, methods, and systems may be implemented in a network (or distributed) computing environment. For example, the computing device may be implemented in a distributed, networked, computing environment. Network environments include enterprise-wide computer networks, intranets, local area networks (LAN), wide area networks (WAN), personal area networks (PAN), cloud computing networks, crowd-sourced computing networks, the Internet, the Internet of Things (IoT) and the World Wide Web. The network may be a wired or a wireless network, a terrestrial or satellite network, or any other type of communication network.
The filters, filter systems and methods disclosed herein have been discussed primarily in relation to real-time signal processing of an input signal, i.e. filtering the input signal whilst data is still being recorded that will in turn be passed to the filter. However, it is to be appreciated any filter, filter system or method may also be used for off-line analysis of input signals.
The following clauses, which are not claims, define further statements of invention.
where s(t) is an input to the respective Prism filter, m is a characteristic frequency of the respective Prism filter, [sin|cos] represents a sine or a cosine operation, and q is an optional phase offset variable, and h is a harmonic number of the respective Prism filter.
where s(t) is an input to the respective Prism filter, m is a characteristic frequency of the respective Prism filter, [sin|cos] represents a sine or a cosine operation, and q is an optional phase offset variable, and h is a harmonic number of the respective Prism filter.
where s(t) is an input to the respective Prism filter, m is a characteristic frequency of the respective Prism filter, [sin|cos] represents a sine or a cosine operation, q is an optional, arbitrary phase offset variable, and h is a harmonic number of the respective Prism filter of the network of Prism filters;
where s(t) is an input to the respective Prism filter, m is a characteristic frequency of the respective Prism filter, [sin|cos] represents a sine or a cosine operation, q is an optional and/or arbitrary phase offset variable, and h is a harmonic number of the respective Prism filter,
Number | Date | Country | Kind |
---|---|---|---|
2117630.0 | Dec 2021 | GB | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/GB2022/052883 | 11/14/2022 | WO |