CN107948573B - Digital signal linear interpolation method and device - Google Patents
Digital signal linear interpolation method and device Download PDFInfo
- Publication number
- CN107948573B CN107948573B CN201711176871.9A CN201711176871A CN107948573B CN 107948573 B CN107948573 B CN 107948573B CN 201711176871 A CN201711176871 A CN 201711176871A CN 107948573 B CN107948573 B CN 107948573B
- Authority
- CN
- China
- Prior art keywords
- test data
- original test
- linear interpolation
- original
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N7/00—Television systems
- H04N7/01—Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level
- H04N7/0135—Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level involving interpolation processes
Abstract
The embodiment of the invention discloses a linear interpolation method of digital signals, which comprises the following steps: acquiring first original test data and second original test data; according to the first original test data and the second original test data, performing linear interpolation calculation to obtain first reference test data, wherein the difference between the X value in the first reference test data and the X value in the first original test data is a power of 2; and performing shift operation on the first reference test data to obtain linear interpolation value data of a range from the first original test data to the second original test data, and outputting the linear interpolation value data. The embodiment of the invention also discloses a linear interpolation device of the corresponding digital signal. According to the embodiment of the invention, the efficiency of obtaining the linear interpolation value can be improved, and the cost can be reduced.
Description
Technical Field
The present invention relates to the field of image digital signal processing technology, and in particular, to a method and an apparatus for linear interpolation of digital signal.
Background
Linear interpolation of digital signals is a commonly used method for processing digital signals with multiple sampling rates, which extends a short low-speed digital signal sequence into a long high-speed digital signal sequence to obtain better resolution and precision in time and amplitude, and is widely used in numerical processing, test measurement, software defined radio, and wireless communication.
In the prior art, although the method for calculating linear interpolation is relatively simple, as shown in fig. 1, a schematic diagram of linear interpolation is shown. Here, the points (x0, y0) and (x1, y1) shown in the figure are known points, and the point (x, y) is a point to be found (i.e., a plug-in point). The interpolation point y can be calculated by the following formula:
y=(x-x0)*(y1-y0)/(x1-x0)+y0
meanwhile, since (y1-y0)/(x1-x0) is a constant, all constants can be approximated by summing a series of consecutive powers of 2 according to the limit theory, when (x1-x0) is the power of 2, the calculation process can be realized by shifting; otherwise, a divider (or multiplier) is needed, and the hardware cost is high.
Therefore, although the conventional linear interpolation method is simple in calculation, the hardware cost is high if the power of 2 is not the power of 2 (a divider is required).
Disclosure of Invention
The present invention is directed to a digital signal linear interpolation method and apparatus, which can improve the efficiency of obtaining linear interpolation and reduce the cost.
In order to solve the above technical problem, an aspect of an embodiment of the present invention provides a linear interpolation method for a digital signal, including the steps of:
acquiring first original test data and second original test data;
calculating according to the first original test data and the second original test data by linear interpolation to obtain first reference test data, wherein the difference between the X value in the first reference test data and the X value in the first original test data is a power of 2, the Y value in the first reference test data is calculated according to the first original test data and the second original test data by linear interpolation, and specifically, the first reference test data is calculated by MATLAB software or VC program;
performing linear interpolation between first original test data and first reference test data, obtaining linear interpolation value data of an interval from the first original test data to the second original test data through a multiplier, an adder and a shift operation according to the following formula, and outputting:
y=(x-x0)*(y2-y0)/(x2-x0)+y0
where point (x0, y0) is the first original test data, point (x2, y2) is the first reference test data, point (x, y) is interpolated data, and (x2-x0) is a power of 2.
The first original test data is starting point data.
Wherein, further include:
acquiring third original test data;
calculating according to the second original test data and the third original test data by linear interpolation to obtain second reference test data, wherein the difference between the X value in the second reference test data and the X value in the second original test data is a power of 2, the Y value in the second reference test data is calculated according to the second original test data and the third original test data by linear interpolation, and specifically, the second reference test data is calculated by MATLAB software or VC program;
performing linear interpolation between second original test data and second reference test data, obtaining linear interpolation value data of an interval from the second original test data to the third original test data through a multiplier, an adder and a shift operation according to the following formula, and outputting:
y=(x-x1)*(y3-y1)/(x3-x1)+y1
where point (x1, y1) is the second original test data, point (x3, y3) is the second reference test data, point (x, y) is the interpolated data, and (x3-x1) is a power of 2.
Accordingly, in another aspect of the embodiments of the present invention, there is also provided a linear interpolation apparatus for a digital signal, including:
the device comprises an original test data acquisition unit, a data processing unit and a data processing unit, wherein the original test data acquisition unit is used for acquiring original test data which at least comprises first original test data and second original test data;
a test data obtaining unit, configured to perform linear interpolation calculation according to the first original test data and the second original test data to obtain first reference test data, where an X value in the first reference test data differs from an X value in the first original test data by a power of 2, a Y value in the first reference test data is calculated according to the first original test data and the second original test data through linear interpolation, and the test data obtaining unit obtains the reference test data through calculation by using MATLAB software or a VC program;
a shift operation unit, configured to perform linear interpolation between first original test data and first reference test data, obtain linear interpolation value data of an interval from the first original test data to the second original test data through a multiplier, an adder, and a shift operation according to the following formula, and output:
y=(x-x0)*(y2-y0)/(x2-x0)+y0
where point (x0, y0) is the first original test data, point (x2, y2) is the first reference test data, point (x, y) is interpolated data, and (x2-x0) is a power of 2.
Wherein, further include: and the storage unit is used for storing the first original test data, the second original test data, the first reference test data and each linear interpolation value.
The embodiment of the invention has the following beneficial effects:
according to the embodiment of the present invention, in order to obtain an interpolation value between two original test data, by first calculating a reference test data by software, the X value of the reference test data being different from the X value of one of the two original test data by a power of 2, and shifting the reference test data, the interpolation value between the two original test data can be obtained, so that the cost of hardware calculation can be reduced (no divider is required), and the calculation efficiency of the interpolation value can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of a conventional linear interpolation;
FIG. 2 is a schematic diagram of a digital signal linear interpolation method provided by the present invention;
FIG. 3 is a schematic diagram of a main flow chart of an embodiment of a digital signal linear interpolation method according to the present invention;
fig. 4 is a main flow chart of an embodiment of a digital signal linear interpolation apparatus according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that, in order to avoid obscuring the present invention with unnecessary details, only the structures and/or processing steps closely related to the scheme according to the present invention are shown in the drawings, and other details not so relevant to the present invention are omitted.
Referring to fig. 2, a schematic diagram of a digital signal linear interpolation method according to the present invention is shown. Here, the points a (x0, y0) and c (x1, y1) shown in the figure are known points, and the point b (x, y) is a candidate point (i.e., a plug-in point). Wherein the difference between x1 and x0 is not a power of 2. If the existing linear interpolation formula is directly adopted, a divider is introduced, so that the logic resource is increased. The method adopted by the invention is to lead a reference point d (x2, y2) to make the difference between x2 and x0 be the power of 2. The point d (x2, y2) can be calculated by linear interpolation, which can be calculated by software (VC or Matlab, etc.). Then, the value of the point b (X, y) can be obtained by two points, namely, the point a (X0, y0) and the point d (X2, y2), since the difference of the X values of the two points (i.e., X2-X0) is the power of 2, so that the y value of the point b can be obtained only by the shift operation, and similarly, other linear interpolation values between the point a and the point c can be obtained.
Fig. 3 is a schematic main flow chart illustrating an embodiment of a digital signal linear interpolation method according to the present invention. In this embodiment, the method comprises the steps of:
step S10, acquiring first original test data and second original test data;
step S12, obtaining first reference test data according to the first original test data and the second original test data by linear interpolation calculation, wherein the difference between the X value in the first reference test data and the X value in the first original test data is a power of 2; specifically, in this step, the first reference test data may be obtained by calculation using MATLAB software or VC program;
step S14, shift the first reference test data to obtain linear interpolation value data of the interval from the first original test data to the second original test data, and output the linear interpolation value data.
It will be appreciated that in one embodiment, the first raw test data may be start point data (i.e., x and y values are both 0).
In one example, similar steps may be included to obtain linearly interpolated data between the second original test data and the subsequent data, as follows:
acquiring third original test data;
calculating according to the second original test data and the third original test data by linear interpolation to obtain second reference test data, wherein the difference between the X value in the second reference test data and the X value in the second original test data is a power of 2;
and performing shift operation on the second reference test data to obtain linear interpolation value data of an interval from the second original test data to the third original test data, and outputting the linear interpolation value data.
It will be appreciated that the raw test data and the reference test data may be in the form of tables, for example, in some image processing applications, each datum may correspond to the gray scale values of the red, yellow and green sub-pixels of a pixel, i.e., a table of data may correspond to three values, which may also be mapped as (x, y, z).
The invention will be further described with reference to specific examples for the purpose of understanding.
Specifically, in one example. Where, the start data plane0 ═ {0,0,0 }; first original test data plane3 ═ {3,6,9 }; second original test data plane6 ═ {6,12,18 }; third original test data plane9 ═ 9,18, 27. It is necessary to calculate an interpolation value between the first original test data and the first original test data, an interpolation value between the first original test data and the second original test data, and an interpolation value between the second original test data and the third original test data. According to the method provided by the invention, the method can be realized by adopting the following steps:
the first step is as follows: from the original data interpolation table, the corresponding data interpolation table close to the starting point by the power of 2) is calculated by MATLAB or VC, i.e. the first reference test data is obtained by linear interpolation of the starting data plane0 and the first original measurement data 1. Specifically, by software, according to the plane0, plane3, the linearly interpolated first reference test data plane4 is {4,8,12}, where the value X in the first reference test data is 4 and differs from the value X in the initial test data by the power of 2;
secondly, according to the first reference test data plane4, each linear interpolation value between the initial data plane0 and the first original measured data plane3 can be obtained, because the difference between the X values of the plane0 and the plane4 is the power of 2, when the linear interpolation values are obtained, only the first reference test data plane4 needs to be shifted; specifically, by performing linear interpolation on the plane0 and the plane4, it is possible to easily obtain the plane1 ═ {1,2,3}, the plane2 ═ 2,4,6}, and the plane3 ═ 3,6,9 }.
Thirdly, according to the first original measurement data plane3 ═ {3,6,9} and the second original measurement data plane6 ═ 6,12,18}, a linearly interpolated second reference test data plane7 ═ 7,14,21} can be calculated by software, wherein the value of X in the second reference test data is 7 and the difference between the value of X in the second original test data and the value of X in the second original test data is a power of 2;
fourthly, according to the second reference test data plane7, each linear interpolation value between the first original measurement data plane3 and the second original measurement data plane6 can be obtained, because the difference between the X values of the plane4 and the plane7 is the power of 2, when the linear interpolation values are realized, each linear interpolation value can be obtained only by shifting the second reference test data plane 7; linear interpolation with the second original transformed table data 2 is sufficient. Specifically, by performing linear interpolation on the plane3 and the plane7, the plane4{4,8,12}, the plane5{5,10,15}, and the plane6{6,12,18} can be easily obtained.
Similarly, a third reference test data plane10 may be obtained according to a similar method by obtaining a third original measurement data plane6 and a third original measurement data plane 9; where the value X of plane10 differs from the value X of plane6 by a power of 2, the values of interpolated plane7, plane8 between plane6 and plane9 can be obtained by shifting according to this third reference test data plane 10.
Accordingly, as shown in fig. 4, a schematic structural diagram of an apparatus 1 for linear interpolation of digital signals according to the present invention is provided, in this embodiment, the apparatus 1 includes:
an original test data obtaining unit 10, configured to obtain original test data, where the original test data at least includes first original test data and second original test data;
the test data acquisition unit 12 is configured to obtain first reference test data by linear interpolation calculation according to the first original test data and the second original test data, where a difference between an X value in the first reference test data and an X value in the first original test data is a power of 2;
a shift operation unit 14, configured to perform a shift operation on the first reference test data, obtain linear interpolation data of an interval from the first original test data to the second original test data, and output the linear interpolation data;
a storage unit 16 for storing the first original test data, the second original test data, the first reference test data, and each linear interpolation value.
The test data obtaining unit 12 obtains the reference test data through calculation by MATLAB software or VC program.
For more details, reference may be made to the foregoing description of fig. 2 and 3.
The embodiment of the invention has the following beneficial effects:
according to the embodiment of the present invention, in order to obtain an interpolation value between two original test data, by first calculating a reference test data by software, the X value of the reference test data being different from the X value of one of the two original test data by a power of 2, and shifting the reference test data, the interpolation value between the two original test data can be obtained, so that the cost of hardware calculation can be reduced (no divider is required), and the calculation efficiency of the interpolation value can be improved.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing is directed to embodiments of the present application and it is noted that numerous modifications and adaptations may be made by those skilled in the art without departing from the principles of the present application and are intended to be within the scope of the present application.
Claims (5)
1. A method for linear interpolation of a digital signal, comprising the steps of:
acquiring first original test data and second original test data;
calculating according to the first original test data and the second original test data by linear interpolation to obtain first reference test data, wherein the difference between the X value in the first reference test data and the X value in the first original test data is a power of 2, the Y value in the first reference test data is calculated according to the first original test data and the second original test data by linear interpolation, and specifically, the first reference test data is calculated by MATLAB software or VC program;
performing linear interpolation between first original test data and first reference test data, obtaining linear interpolation value data of an interval from the first original test data to the second original test data through a multiplier, an adder and a shift operation according to the following formula, and outputting:
y=(x-x0)*(y2-y0)/(x2-x0)+y0
where point (x0, y0) is the first original test data, point (x2, y2) is the first reference test data, point (x, y) is interpolated data, and (x2-x0) is a power of 2.
2. The digital signal linear interpolation method of claim 1, wherein the first original test data is start point data.
3. The method of linear interpolation of a digital signal according to any of claims 1 to 2, further comprising:
acquiring third original test data;
calculating according to the second original test data and the third original test data by linear interpolation to obtain second reference test data, wherein the difference between the X value in the second reference test data and the X value in the second original test data is a power of 2, the Y value in the second reference test data is calculated according to the second original test data and the third original test data by linear interpolation, and specifically, the second reference test data is calculated by MATLAB software or VC program;
performing linear interpolation between second original test data and second reference test data, and obtaining and outputting linear interpolation value data of an interval from the second original test data to the third original test data through a multiplier, an adder and shift operation according to the following formula:
y=(x-x1)*(y3-y1)/(x3-x1)+y1
where point (x1, y1) is the second original test data, point (x3, y3) is the second reference test data, point (x, y) is the interpolated data, and (x3-x1) is a power of 2.
4. An apparatus for linear interpolation of a digital signal, comprising:
the device comprises an original test data acquisition unit, a data processing unit and a data processing unit, wherein the original test data acquisition unit is used for acquiring original test data which at least comprises first original test data and second original test data;
a test data obtaining unit, configured to perform linear interpolation calculation according to the first original test data and the second original test data to obtain first reference test data, where an X value in the first reference test data differs from an X value in the first original test data by a power of 2, a Y value in the first reference test data is calculated according to the first original test data and the second original test data through linear interpolation, and the test data obtaining unit obtains the reference test data through calculation by using MATLAB software or a VC program;
a shift operation unit, configured to perform linear interpolation between first original test data and first reference test data, obtain linear interpolation value data of an interval from the first original test data to the second original test data through a multiplier, an adder, and a shift operation according to the following formula, and output:
y=(x-x0)*(y2-y0)/(x2-x0)+y0
where point (x0, y0) is the first original test data, point (x2, y2) is the first reference test data, point (x, y) is interpolated data, and (x2-x0) is a power of 2.
5. The digital signal linear interpolation apparatus of claim 4, further comprising: and the storage unit is used for storing the first original test data, the second original test data, the first reference test data and each linear interpolation value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711176871.9A CN107948573B (en) | 2017-11-22 | 2017-11-22 | Digital signal linear interpolation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711176871.9A CN107948573B (en) | 2017-11-22 | 2017-11-22 | Digital signal linear interpolation method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107948573A CN107948573A (en) | 2018-04-20 |
CN107948573B true CN107948573B (en) | 2020-11-03 |
Family
ID=61929882
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711176871.9A Active CN107948573B (en) | 2017-11-22 | 2017-11-22 | Digital signal linear interpolation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107948573B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115979277B (en) * | 2023-02-22 | 2023-06-02 | 广州导远电子科技有限公司 | Time synchronization method, apparatus, electronic device, and computer-readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5886911A (en) * | 1997-01-29 | 1999-03-23 | Winbond Electronics Corp. | Fast calculation method and its hardware apparatus using a linear interpolation operation |
CN101371251A (en) * | 2005-12-28 | 2009-02-18 | 意大利电信股份公司 | Interpolation method and correlated equipment for signal channel estimation in communication system |
CN101371789A (en) * | 2007-08-22 | 2009-02-25 | 深圳迈瑞生物医疗电子股份有限公司 | Real-time computing method and device for focalization delay parameters of beam-forming |
CN104731551A (en) * | 2013-12-23 | 2015-06-24 | 浙江大华技术股份有限公司 | FPGA (field programmable gate array) based division operation method and FPGA based division operation device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3183155B2 (en) * | 1996-03-18 | 2001-07-03 | 株式会社日立製作所 | Image decoding apparatus and image decoding method |
-
2017
- 2017-11-22 CN CN201711176871.9A patent/CN107948573B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5886911A (en) * | 1997-01-29 | 1999-03-23 | Winbond Electronics Corp. | Fast calculation method and its hardware apparatus using a linear interpolation operation |
CN101371251A (en) * | 2005-12-28 | 2009-02-18 | 意大利电信股份公司 | Interpolation method and correlated equipment for signal channel estimation in communication system |
CN101371789A (en) * | 2007-08-22 | 2009-02-25 | 深圳迈瑞生物医疗电子股份有限公司 | Real-time computing method and device for focalization delay parameters of beam-forming |
CN104731551A (en) * | 2013-12-23 | 2015-06-24 | 浙江大华技术股份有限公司 | FPGA (field programmable gate array) based division operation method and FPGA based division operation device |
Also Published As
Publication number | Publication date |
---|---|
CN107948573A (en) | 2018-04-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108519511B (en) | Time domain measurement method for frequency characteristic parameters of linear frequency modulation signals | |
CN110488228B (en) | Linear frequency modulation signal generation method and device and storage medium | |
CN109521992B (en) | Linear frequency modulation signal generation method without multiplier based on CORDIC algorithm | |
CN103067016B (en) | A kind of streamline time to digital converter device and method thereof | |
CN107948573B (en) | Digital signal linear interpolation method and device | |
US7352305B2 (en) | Method and circuit for interpolating encoder output | |
CN115979324A (en) | Nonlinear calibration method and device for magnetic encoder | |
CN109977348B (en) | Data compression method and device, storage medium and radar system | |
CN108204830B (en) | The compensation method of phase deviation and device | |
CN110441599A (en) | A kind of demodulation method and device, readable storage medium storing program for executing for frequency spectrograph | |
CN107203495B (en) | S parameter circular interpolation method | |
CN110865531A (en) | Time interval measuring method and system based on nonlinear regression | |
CN113298778B (en) | Depth calculation method and system based on flight time and storage medium | |
CN100427958C (en) | Agitating measuring device and measuring method | |
JP2015078863A (en) | Interpolation method of encoder, and interpolation device | |
CN109541309B (en) | Spectrum analyzer and signal processing method thereof | |
CN108871385B (en) | Encoder, motor, encoder data processing method, and storage medium | |
US8531223B2 (en) | Signal generator | |
CN111721210A (en) | Initialization method, device, equipment and medium after conversion of logical raster resolution | |
CN101571377B (en) | Absolute coding raster phase subdivision method based on charge coupling device | |
CN107247819B (en) | Filtering method and filter for sensor | |
CN116659395B (en) | Phase compensation-based nonlinear synchronous error correction method for frequency sweep interferometry | |
CN116659394B (en) | Time-delay resampling-based nonlinear synchronous error correction method for frequency sweep interferometry | |
CN111581599B (en) | Weight value output method and digital weighing transmitter | |
CN113659936B (en) | Segmentation point determination method and device for linearization model |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder | ||
CP01 | Change in the name or title of a patent holder |
Address after: No.9-2 Tangming Avenue, Guangming New District, Shenzhen, Guangdong 518000 Patentee after: TCL Huaxing Photoelectric Technology Co.,Ltd. Address before: No.9-2 Tangming Avenue, Guangming New District, Shenzhen, Guangdong 518000 Patentee before: Shenzhen China Star Optoelectronics Technology Co.,Ltd. |