EFFICIENT CODEC FOR ELECTRICAL SIGNALS

20230412191 ยท 2023-12-21

    Inventors

    Cpc classification

    International classification

    Abstract

    A method for compressing a signal, the method comprising: acquiring, via a signal recording module, a primary signal; modelling, via a processor, a model signal of the primary signal by: acquiring, via the processor, a sampled signal; acquiring, via the processor, a windowed signal; and extracting, via the processor: a fundamental frequency waveform having a fundamental magnitude and a fundamental phase; and at least one harmonic frequency waveform having a harmonic magnitude and a harmonic phase; wherein the model signal comprises the fundamental frequency waveform and the at least one harmonic frequency waveform; calculating, via the processor, an error signal between a reconstructed signal and the primary signal; determining, via the processor, an optimal gain from at least; an averaging step providing an average value, a predefined threshold, and a scaled signal.

    Claims

    1-22. (canceled)

    23. A method for compressing a signal, the method comprising: acquiring, via a signal recording module, a primary signal; modelling, via a processor, a model signal of the primary signal by: acquiring, via the processor, a sampled signal; acquiring, via the processor, a windowed signal; and extracting, via the processor: a fundamental frequency waveform having a fundamental magnitude, a fundamental phase and a fundamental frequency; and at least one harmonic frequency waveform having a harmonic magnitude and a harmonic phase and a fundamental frequency; wherein the model signal comprises the fundamental frequency waveform and the at least one harmonic frequency waveform; calculating, via the processor, an error signal between a reconstructed signal and the primary signal; determining, via the processor, an optimal gain from at least; an averaging step providing an average value, a predefined threshold, and a scaled signal, wherein the scaled signal is a historical error signal scaled by a predefined gain by iteratively: averaging a difference between the error signal and the scaled signal, wherein the optimal gain comprises the predefined gain when the average value meets the predefined threshold; determining, via the processor, an index from a residual signal by: determining the residual signal; vector quantising the residual signal; and indexing the vector quantised residual signal; composing, via the processor, a compressed signal, wherein the compressed signal comprises: the fundamental phase; the fundamental magnitude; the fundamental frequency; the harmonic phase; the harmonic magnitude; the harmonic frequency; the optimal gain; and the index.

    24. The method of claim 23, wherein: the sample signal is acquired by sampling, via the processor, the primary signal at the Nyquist rate; the windowed signal is acquired by applying, via the processor, a window function to the sampled signal; and the fundamental frequency waveform and the at least one harmonic frequency waveform are extracted by applying, via the processor, a Fast Fourier Transform to the windowed signal.

    25. The method of claim 23, wherein the reconstructed signal is based on the model signal.

    26. The method of claim 23, wherein the error signal is calculated by subtracting the reconstructed signal from the primary signal.

    27. The method of claim 23, wherein determining the optimal gain comprises the iterative steps of: i. encoding, via the processor, the scaled signal; wherein the scaled signal is encoded by multiplying, via the processor, the historical error signal by the predefined gain; ii. subtracting, via the processor, the scaled signal from the error signal, thereby creating the difference; iii. calculating, via the processor, the average value of the difference; iv. comparing, via the processor, the average value to the predefined threshold; and v. repeating steps i. to iv. wherein the predefined gain is a new gain.

    28. The method of claim 26, wherein the historical error signal is an error signal from a previous time interval, stored in a data store.

    29. The method of claim 26, wherein the new gain is calculated, via the processor, using a stochastic descent algorithm.

    30. The method according to claim 23, wherein the residual signal is encoded by determining the difference between the error signal and the historical error signal.

    31. The method of claim 23, wherein the residual signal is vector quantised with respect to a predefined codebook, wherein the predefined codebook is stored in the data store.

    32. The method of claim 23, wherein the residual signal is delta encoded, thereby producing a delta encoded coefficient.

    33. The method according to claim 23, wherein the compressed signal is stored in the data store or transmitted via a transmitter.

    34. A method for decompressing a compressed signal, the method comprising: extracting, via a processor, a residual signal; and reconstructing, via the processor, a primary signal.

    35. The method of claim 34, wherein the compressed signal comprises: a fundamental phase; a fundamental magnitude; a fundamental frequency; a harmonic phase; a harmonic magnitude; a harmonic frequency; an optimal gain; and an index.

    36. The method of claim 34, wherein the compressed signal comprises: a fundamental phase; a fundamental magnitude; a fundamental frequency; a harmonic phase; a harmonic magnitude; a harmonic frequency; an optimal gain; and a delta encoded coefficient.

    37. The method according to claim 35, wherein extracting the residual signal comprises: comparing, via the processor, the index to a predefined codebook, wherein the predefined codebook is stored in a data store; and recreating, via the processor, the residual signal based on the index.

    38. The method according to claim 36, wherein extracting the residual signal comprises: decoding, via the processor, the delta encoded coefficient; and recreating, via the processor, the residual signal based on the decoded delta encoded coefficient.

    39. The method according to claim 33, wherein reconstructing the primary signal comprises: summing, via the processor, the residual signal with a historic residual signal multiplied by the optimal gain, thereby creating a summed residual signal; recreating, via the processor, a sinusoidal component of the primary signal based on: the fundamental phase; the fundamental magnitude; the fundamental frequency; the harmonic phase; the harmonic magnitude; and the harmonic frequency; summing, via the processor, the summed residual signal and the sinusoidal component, thereby reconstructing the primary signal.

    40. The method according to claim 39, wherein the historical residual signal is a residual signal from a previous time interval stored in the data store.

    41. The method as claimed in claim 23, further comprising the method steps of: extracting, via a processor, a residual signal; and reconstructing, via the processor, a primary signal.

    42. A system for compressing a signal, the system comprising: a signal recording module configured to acquire a primary signal; a data store comprising: a historical error signal; a predefined codebook; and a processor configured to: model a model signal; calculate an error signal; determine an optimal gain; determine an index; determine a delta encoded coefficient and compose a compressed signal; a transmitter configured to transmit the compressed signal.

    43. The system as claimed in claim 42, wherein the processor is further configured to: acquire a sampled signal; acquire a windowed signal; apply a Fast Fourier Transform to the windowed signal; extract a fundamental frequency waveform and at least one harmonic frequency waveform; calculate a reconstructed signal; subtract the reconstructed signal from the primary signal; multiply the historical error signal by the predefined gain, thereby obtaining a scaled signal; average a difference between the error signal and the scaled signal; subtract the scaled signal from the error signal, thereby creating a resulting signal; calculate the average value of the resulting signal; compare the average value to the predefined threshold; repeat the step of extracting the delayed component using a new gain until the average value meets the predefined threshold; calculate the new gain using a stochastic descent algorithm; vector quantise the residual signal with respect to the predefined codebook; delta encode the coefficients; and compose the compressed signal by combining: the fundamental phase; the fundamental magnitude; the fundamental frequency; the harmonic phase; the harmonic magnitude; the harmonic frequency; the optimal gain; and the index or the delta encoded coefficient.

    44. A system for decompressing a compressed signal, the system comprising: a receiver configured to receive a compressed signal, the compressed signal comprising: a fundamental phase; a fundamental magnitude; a fundamental frequency; a harmonic phase; a harmonic magnitude; a harmonic frequency; an optimal gain; and an index or a delta encoded coefficient; a data store comprising: a predefined codebook; and a historic residual signal; a decompression unit comprising a processor, the processor being configured to: extract a residual signal; multiply the historical residual signal by the optimal gain; sum the residual signal with the multiplied historic residual signal, thereby creating the summed residual signal; recreate the primary signal; sum the primary signal and the summed residual signal.

    Description

    DETAILED DESCRIPTION

    [0037] Specific embodiments will now be described by way of example only, and with reference to the accompanying drawings, in which:

    [0038] FIG. 1 shows a schematic view of an energy management system in a circuit;

    [0039] FIG. 2 shows a schematic view of a compression method for compressing a signal in accordance with the first aspect of the present invention;

    [0040] FIG. 3 shows a schematic view of a decompression unit; and

    [0041] FIG. 4 shows a schematic view of a decompression method for decompressing a compressed signal in accordance with the second aspect of the present invention.

    [0042] Referring to FIG. 1, there is shown a schematic view of an energy management system 100 in a circuit 101. The energy management system 100 comprises a signal recording module 102, a data store 104, a compression unit 106, a transmitter 108 and a processor 110. The data store 104 comprises a historic error signal 105, a predefined gain 107, a predefined threshold 109 and a codebook 111. The codebook 111 comprises a number of indexes.

    [0043] In use, and with reference to FIG. 2, there is shown a compression method 200 for compressing a signal in accordance with the first aspect of the present invention.

    [0044] At step 202, the signal recording module 102 records a primary signal 203. The primary signal may be a current or voltage signal corresponding to the circuit 101.

    [0045] At step 204, the processor 110 samples the primary signal at the Nyquist rate, thereby creating a sampled signal 205.

    [0046] At step 206, the processor 110 applies a hamming window to the sampled signal 205, thereby creating a windowed signal 207.

    [0047] At step 208, the processor 110 applies a Fast Fourier Transform to the windowed signal 207, thereby creating a spectrum 209 of the windowed signal 207.

    [0048] At step 210, the processor 110 extracts a fundamental signal and a first six harmonic signals from the spectrum 209.

    [0049] At step 212, the processor 110 extracts a fundamental magnitude, a fundamental phase and a fundamental frequency from the fundamental signal of the spectrum 209. The processor 110 further extracts a harmonic magnitude, a harmonic phase and a harmonic frequency from each of the six harmonic signals of the spectrum 209. The fundamental magnitude, fundamental phase, harmonic magnitude and harmonic phase are stored in the data store 104.

    [0050] At step 214, the processor 110 recreates a model signal 215 using the fundamental magnitude, the fundamental phase, the fundamental frequency, the harmonic magnitude, the harmonic phase, and the harmonic frequency.

    [0051] At step 216, the processor 110 subtracts the model signal 215 from the primary signal 205, thereby creating an error signal 217.

    [0052] At step 218, the processor 110 initiates an iterative process by multiplying the historic error signal 105 by the predefined gain 107. The multiplication by the predefined gain 107 thereby creates a scaled signal 219.

    [0053] At step 220, the processor 110 subtracts the scaled signal 219 from the error signal 217. The subtractions of the scaled signal 2019 from the error signal 217 thereby creates a resulting signal 221.

    [0054] At step 222, the processor 110 calculates the average value of the difference and compares the average value with the predefined threshold 109.

    [0055] At step 224, if the average value meets the predefined threshold 109, then step 226 does not occur and the predefined gain is output as an optimal gain 225. If the average value does not meet the predefined threshold 109, then step 226 occurs.

    [0056] At step 226, the predefined gain is adjusted to a new gain 227 using a stochastic descent algorithm and steps 218 to 224 are repeated with the predefined gain 107 being the new gain 227.

    [0057] At step 228, the processor 110 subtracts the error signal 217 from the historical error signal 105, thereby creating a residual signal 229.

    [0058] At step 230, the processor 110 compares the residual signal 229 to the indexes in the codebook 111 in order to vector quantise the residual signal 229 as a number of residual indexes 231.

    [0059] At step 232, the processor 110 composes a compressed signal 233 comprising the fundamental magnitude, the fundamental phase, the fundamental frequency, the harmonic magnitude, the harmonic phase, the harmonic frequency, the optimal gain 225 and the residual indexes 231. It should be noted that the compressed signal 233 comprises the harmonic magnitude, the harmonic phase and the harmonic frequency of each of the six harmonic waveforms.

    [0060] At step 234, the transmitter 108 transmits the compressed signal 233.

    [0061] With reference to FIG. 3, there is shown a schematic view of a decompression unit 300.

    [0062] The decompression unit 300 comprises a processor 302, a receiver 304 and a data store 306. The data store 306 comprises a codebook 308 and a historic residual signal 312. The codebook 308 is substantially similar to the codebook 111 as described in FIG. 1 and comprises a number of indexes.

    [0063] In use, and with reference to FIG. 4, there is shown a schematic view of a decompression method 400 for decompressing the compressed signal 233 in accordance with the second aspect of the present invention.

    [0064] At step 402, receiver 304 receives the compressed signal 233 and stores the compressed signal 233 in the data store 306. The compressed signal 233 comprises the fundamental magnitude, the fundamental phase, the fundamental frequency, the harmonic magnitude, the harmonic phase, the harmonic frequency, the optimal gain 225 and the residual indexes 231.

    [0065] At step 404, the processor 302 compares the residual indexes 231 to the indexes in the codebook 308 and creates a reconstructed residual signal 405 based on the indexes that match the residual indexes 231. The reconstructed residual signal 405 will be similar, but with some information lost, to the residual signal 229.

    [0066] At step 406, the processor multiplies the historic residual signal 312 by the optimal gain 225, thereby creating a scaled historic residual signal 407.

    [0067] At step 408, the processor sums the reconstructed residual signal 405 with the scaled historic residual signal 407, thereby creating a summed residual signal 409.

    [0068] At step 410, the processor combines the fundamental magnitude, the fundamental phase, the fundamental frequency, thereby creating a fundamental sinusoidal signal 411.

    [0069] At step 412, the processor combines the harmonic magnitude, the harmonic phase, and the harmonic frequency, thereby creating a harmonic sinusoidal signal 413.

    [0070] At step 414, the processor sums the fundamental sinusoidal signal 411 with the harmonic sinusoidal signal 413, thereby creating a sinusoidal signal 415.

    [0071] At step 416, the processor sums the sinusoidal signal 415 with the summed residual signal 409, thereby creating a decompressed signal 417. The decompressed signal 417 is substantially similar to the primary signal 203 but with some information lost.

    [0072] It will be appreciated that the above described embodiments are given by way of example only and that various modifications may be made to the described embodiments without departing from the scope of the invention as defined by the appended claims. For example, the primary signal may be current, voltage or any other circuit indicator. Further, there could be any number of harmonic signals extracted from the primary signal. Further, the primary signal may be sampled at any sampling rate and any windowing function may be applied to the sampled signal. Further, any suitable algorithm may be used to converge on an optimal gain value.