CN106972840A - A kind of sampling rate converting method and device - Google Patents
A kind of sampling rate converting method and device Download PDFInfo
- Publication number
- CN106972840A CN106972840A CN201710113085.8A CN201710113085A CN106972840A CN 106972840 A CN106972840 A CN 106972840A CN 201710113085 A CN201710113085 A CN 201710113085A CN 106972840 A CN106972840 A CN 106972840A
- Authority
- CN
- China
- Prior art keywords
- sampling point
- original
- original sampling
- target
- frequency
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03H—IMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
- H03H17/00—Networks using digital techniques
- H03H17/02—Frequency selective networks
- H03H17/06—Non-recursive filters
- H03H17/0621—Non-recursive filters with input-sampling frequency and output-delivery frequency which differ, e.g. extrapolation; Anti-aliasing
- H03H17/0635—Non-recursive filters with input-sampling frequency and output-delivery frequency which differ, e.g. extrapolation; Anti-aliasing characterized by the ratio between the input-sampling and output-delivery frequencies
- H03H17/0685—Non-recursive filters with input-sampling frequency and output-delivery frequency which differ, e.g. extrapolation; Anti-aliasing characterized by the ratio between the input-sampling and output-delivery frequencies the ratio being rational
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Mathematical Physics (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
- Complex Calculations (AREA)
Abstract
This application discloses a kind of sample rate conversion equipment, including signal reconstruction controller, filter factor generator and low pass filter, wherein, signal reconstruction controller is according to original sampling frequency and destination sample frequency, relative position information of each target sampling point relative to the original sampling point of its nearest neighbours in target sequence is calculated on the time dimension of original series, phase accumulator is used to be added up by step value of frequency control word again, and the spilling number of times of phase accumulator in cumulative process each time is counted, according to the original sampling point of participation overflowed required for number of times determines selection;Filter factor generator calculates the filter factor of each target sampling point in real time according to the relative position information of each target sampling point;Original sampling point progress LPF is finally participated in selected according to filter factor using low pass filter, each target sampling point is obtained, obtains target sequence, realize that sample rate is changed.Correspondingly, disclosed herein as well is a kind of sampling rate converting method.
Description
Technical field
The application is related to electronic instrumentation, more particularly to a kind of sampling rate converting method and device.
Background technology
For software radio, radio communication, test measurement and radar detection, it usually needs to after analog-to-digital conversion or
Data signal before digital-to-analogue conversion carries out a certain proportion of sample rate conversion, i.e., by the corresponding sample rate of data signal by some
Sample rate is transformed into another sample rate.Traditional small scale sample rate conversion is generally using the conversion side as shown in Fig. 1 (a)
By being f to sample rate in method, Fig. 1 (a)s1Original series x (n) first carry out L times of interpolation processing, then cut again by one
Only frequency is min (π/L, π/M) LPF, and the extraction that then again the data after LPF are carried out with M times is handled, and is obtained
Final sample rate is fs2Target sequence y (n).For the conversion of vast scale sample rate, traditional method uses small scale sample rate
Filtering interpolation or filtering extraction are carried out on the basis of conversion, shown in such as Fig. 1 (b), when liter sample rate is changed, in Fig. 1 (a) base
On plinth, for the data after M times of extraction processing, CIC filtering interpolation processing is also carried out, then obtain final target sequence y (n);
Down-sampled rate is according to the principle as shown in Fig. 1 (c), i.e., on the basis of Fig. 1 (a), and L times slotting is being carried out to original series x (n)
Before value processing, CIC filtering extraction processing is also carried out.
Prior art is needed when carrying out sample rate conversion by first interpolation, post filtering, the complex process extracted again,
Wherein, the scope of small scale sample rate conversion is very limited, is only capable of the decimal between support 0~2, and decimal digits can only have been supported
Several of limit, precision is also limited, it is impossible to accomplish to support the rational sample rate of any multiple to change.For the sample rate of vast scale
Conversion, prior art needs that CIC interpolation filters or CIC decimation filters is used in combination to realize, structure is relatively fixed, no
It can support that any times of several litres of sampling and any multiple are down-sampled simultaneously, it is impossible to the field of real-time change is needed applied to sample rate
Close, in addition, when interpolation multiple or extracting multiple than it is larger when, more hardware money can be expended when cic filter hardware is realized
Source.
The content of the invention
The application provides a kind of sampling rate converting method and device, realizes that the rational sample rate for supporting any multiple turns
Change, vast scale can support that any times of several litres of sampling and any multiple are down-sampled simultaneously when changing, the scope and precision of conversion are higher.
According to the application's in a first aspect, the application provides a kind of sampling rate converting method, including:
Obtain original sampling frequency and destination sample frequency;
Original series are obtained, the original series are the data sequences of the original sampling point composition obtained using original sampling frequency
Row;
Relative position information calculation procedure, according to original sampling frequency and destination sample frequency, in the time of original series
In dimension calculate target sequence in each target sampling point relative to the relative position information of the original sampling point of its nearest neighbours, each target
Sampling point one relative position information of correspondence;
Original sampling point selects step, selects original for the participation required for calculating each target sampling point in original series
Sampling point;
Filter factor generation step, according to the relative position information of each target sampling point, calculates each target sampling point in real time
Filter factor;
Filter step, according to the filter factor, participates in exporting target sample after original sampling point is filtered to selected
Point, obtains target sequence.
In certain embodiments, the number and the number of filter factor of the original sampling point of participation required for each target sampling point
It is identical, the number and the equal length of wave filter of the filter factor corresponding to each target sampling point.
In certain embodiments, relative position information calculation procedure includes:
A relative position information is often calculated, then the phase of phase accumulator is carried out once by step value of frequency control word
It is cumulative, obtain the phase value of phase accumulator, the frequency control word and original sampling frequency and the ratio of destination sample frequency
It is directly proportional;
Relative position information is calculated using following calculation formula:
In formula, index represents relative position information, and mod (a, b) represents to take a to b modulus value;Round (s) represents to enter s
Row round;fs1For original sampling frequency;fs2For destination sample frequency;L is an integer, and meets L≤2N;
Acc is the phase value of phase accumulator, and its initial value is zero;N is phase accumulator digit.
In certain embodiments, the original sampling point selection step includes:
Phase accumulator in this cumulative process is counted using number of times counter is overflowed after phase accumulator adds up every time
Total spilling number of times Q, Q (n)=Q (n-1)+M, M is spilling time numerical value when phase accumulator adds up every time;
According to total spilling number of times Q, the original continuously with the equal length number of wave filter is selected in original series
Beginning sampling point is as original sampling point is participated in, and it is the original sampling point of starting to participate in original sampling point with original sampling point X (Q).
In certain embodiments, the calculation formula of the filter factor is:
Wherein, P is filter length.
In certain embodiments, it is filtered using below equation:
According to the second aspect of the application, the application provides a kind of sample rate conversion equipment, including:
Signal reconstruction controller, obtains original sampling frequency and destination sample frequency;Obtain original series, the original sequence
Row are the data sequences of the original sampling point composition obtained using original sampling frequency;According to original sampling frequency and destination sample frequency
Rate, calculates phase of each target sampling point relative to the original sampling point of its nearest neighbours in target sequence on the time dimension of original series
To positional information;Select for calculating the original sampling point of participation required for each target sampling point;
Filter factor generator, according to the relative position information of each target sampling point, calculates the filtering system of each target sampling point
Number;
Low pass filter, according to the filter factor, exports target sampling point after being filtered to selected original sampling point,
Obtain target sequence.
In certain embodiments, the signal reconstruction controller includes:
DDS phase accumulators, are added up by step value of frequency control word, when relative position computer operation once
When, phase accumulator is accumulated once, and the frequency control word is directly proportional to the ratio of original sampling frequency and destination sample frequency;
Relative position calculator, obtains original sampling frequency and destination sample frequency;Obtain original series, the original sequence
Row are the data sequences of the original sampling point composition obtained using original sampling frequency;According to original sampling frequency and destination sample frequency
Rate, calculates phase of each target sampling point relative to the original sampling point of its nearest neighbours in target sequence on the time dimension of original series
To positional information;
Number of times counter is overflowed, the phase accumulator in this cumulative process is counted after DDS phase accumulators are cumulative every time
Total spilling number of times Q, Q (n)=Q (n-1)+M, M is spilling time numerical value when phase accumulator adds up every time;
Original sampling point selector, according to total spilling number of times Q, selects continuous P original sampling points in original series
As original sampling point is participated in, it is the original sampling point of starting to participate in original sampling point with original sampling point X (Q).
According to the third aspect of the application, the application provides another sample rate conversion equipment, including:
Memory, for depositing program;
Processor, for realizing above-mentioned sampling rate converting method by performing the program of the memory storage.
According to the fourth aspect of the application, the application provides a kind of computer-readable recording medium, including program, the journey
Sequence can be executed by processor to realize above-mentioned sampling rate converting method.
The beneficial effect of the application is:The application is according to original sampling frequency and destination sample frequency, dexterously original
Each target sampling point in target sequence is calculated on the time dimension of sequence relative to the relative position of the original sampling point of its nearest neighbours to believe
Breath, according to the relative position information, directly calculates filter factor required when obtaining each target sampling point in real time, and according to calculating
The total spilling number of times counted during relative position information, selects the original sampling point of required participation, then basis from original series
The original sampling point of participation of the filter factor to selection is filtered, and is reached the purpose of sample rate conversion, is realized signal reconstruction, this
The signal reconstruction of sample need not simultaneously significantly increase sample rate and turn to carrying out vast scale interpolation between each sampling point of original series
The efficiency changed, the real-time of sample rate conversion preferably can support the rational resampling of any multiple.
Brief description of the drawings
Fig. 1 is the sample rate transfer principle figure of prior art;
A kind of sampling rate converting method flow chart that Fig. 2 provides for the application;
A kind of sample rate conversion device structure block diagram that Fig. 3 provides for the application;
A kind of signal reconstruction controller architecture block diagram that Fig. 4 provides for the application;
Fig. 5 rises sample rate transition diagram for the sample rate conversion equipment that the application is provided;
Fig. 6 is the down-sampled rate transition diagram of sample rate conversion equipment that the application is provided;
Another sample rate conversion device structure block diagram that Fig. 7 provides for the application;
Fig. 8 provides the original series and comparison of wave shape before and after the conversion of target sequence sample rate of embodiment example for the application
Figure;
Fig. 9 is the original series spectrogram of the embodiment of the present application example;
Figure 10 is target sequence spectrogram after the sample rate conversion of the embodiment of the present application example.
Embodiment
An explanation is made to present invention design first.
Because sample rate conversion proportion is probably integer, it is also possible to arbitrary small number, it may be possible to which small scale sample rate is changed,
It is also likely to be the conversion of vast scale sample rate, sample frequency may be risen, it is also possible to which down-sampled frequency, the application takes into account various situations,
Solve the indeterminable problem of prior art.
First, the application considers that the relation of input/output signal frequency before and after being changed according to sample rate carries out signal reconstruction,
Targetedly selection obtains the original sampling point that each sampling point of output needs in original series, comes without vast scale filtering interpolation
Reconstruct intermediate sequence so that the more efficient of signal reconstruction, purpose are stronger.
Secondly, the application considers the relation of input/output signal frequency before and after being changed according to sample rate, obtains filter factor,
And LPF is carried out to the original sampling point of participation after reconstruct according to the filter factor, so that realize that sample rate is changed, sample rate
Transfer process median filter coefficient is real-time generation, supports any times of several litres of sample rates and the down-sampled rate conversion of any multiple, turns
The ratio of changing can be the rational of arbitrary size, including integer and decimal.
The application is described in further detail below by embodiment combination accompanying drawing.
Embodiment one:
With reference to Fig. 2, this application provides a kind of sampling rate converting method, including step:
Obtain original sampling frequency fs1With destination sample frequency fs2;
Original series x (n) is obtained, original series x (n) is to use original sampling frequency fs1Obtained original sampling point composition
Data sequence;
Relative position information calculation procedure, according to original sampling frequency fs1With destination sample frequency fs2, in original series x
(n) relative position of each target sampling point relative to the original sampling point of its nearest neighbours in target sequence y (n) is calculated on time dimension
Information index (n);
Original sampling point selects step, is selected in original series x (n) for calculating the participation required for each target sampling point
Original sampling point;
Wherein, the number for participating in original sampling point required for calculating each target sampling point is identical with the number of filter factor;
Filter factor generation step, according to the relative position information of each target sampling point, calculates the filtering of each target sampling point
Coefficient;
Wherein, the number of the filter factor corresponding to each target sampling point is determined according to the length P of wave filter, it is preferable that
The number of filter factor corresponding to each target sampling point is equal with the length P of wave filter;
Filter step, according to the filter factor, exports target sampling point, obtains after being filtered to selected original sampling point
To target sequence.
Specifically, relative position information calculation procedure includes:
Often calculate a relative position information, phase accumulator under clock signal control, the phase of phase accumulator with
Frequency control word FTW is that step value carries out one-accumulate, obtains the phase value of phase accumulator, the frequency control word with it is original
The ratio of sample frequency and destination sample frequency is directly proportional;Assuming that phase accumulator digit is N, then according to original sampling frequency
fs1With destination sample frequency fs2, can calculate and obtain corresponding frequency control word and be
FTW=round (2N×fs1/fs2) (1-1)
Wherein, round (s) represents to ask whole computing to rounding up for s.
Relative position information is calculated by following equation,
In formula, above-mentioned formula represents to take to round formulaInteger part;
Wherein, L is an integer, and meets L≤2N, typically take L=2N;Acc is the phase of phase accumulator
Value, its initial value is zero, and the phase value of phase accumulator is calculated as follows:
Acc (n)=mod (Acc (n-1)+FTW, 2N) (1-3)
Wherein, mod (a, b) represents to take a to b modulus value.
Then, formula (1-2) is deployed, formula (1-2) is expressed as
It will thus be seen that according to original sampling frequency fs1With destination sample frequency fs2, can original series x (n) time
Relative position information index of each target sampling point relative to the original sampling point of its nearest neighbours in target sequence y (n) is calculated in dimension
(n)。
Specifically, original sampling point selection step includes:
Phase accumulator in this cumulative process is counted using number of times counter is overflowed after phase accumulator adds up every time
Total spilling number of times Q, Q (n)=Q (n-1)+M, M is spilling time numerical value when phase accumulator adds up every time;
According to total spilling number of times Q, the original continuously with the equal length number of wave filter is selected in original series
Beginning sampling point is as original sampling point is participated in, and it is the original sampling point of starting to participate in original sampling point with original sampling point X (Q).
In the solution procedure of target sampling point, the original sampling point of its nearest neighbours can also use x (Q) table when calculating some target sampling point
Show, the original sampling point X (Q) nearest from target sampling point is initially x (1), during phase accumulator is phase-accumulated, over time
Passage, the nearest original sampling point of target sampling point may change, gradually become x (2), x (3) ..., this change shows
As being referred to as spillover.A relative position information is calculated, phase accumulator is accumulated once, may gone out in cumulative process
Existing spillover, when the original sampling point nearest from target sampling point changes, on original series x (n) time dimension, mesh
Standard specimen point spans an original sampling point and is just denoted as overflowing once, and spilling number of times when phase accumulator adds up every time is represented with M
Value.Phase accumulator is often accumulated once, it is necessary to calculate total spilling the number of times Q, Q (n) of phase accumulator in this cumulative process=Q
(n-1)+M.The starting point of the original sampling point of participation according to required for total spilling number of times Q come each target sampling point of Adjustable calculation, root
According to total spilling number of times Q, select continuous P original sampling points as original sampling point is participated in original series, participate in original
Sampling point is the original sampling point of starting with original sampling point X (Q).
As can be seen here, total number of times Q and relative position information index (n) that overflows is closely related, if phase accumulator is cumulative
Overflow, Q values change, and index (n) also will correspondingly change, when calculating index (n), target sampling point spans original
The number of sampling point is exactly total spilling number of times.It can thus be stated that overflowing number of times Q according to total, continuous P is selected in original series
Individual original sampling point is as participating in original sampling point, that is, the participation required for being determined according to relative position information index (n) is former
Beginning sampling point.
Need to use according to formula (1-2) and nyquist sampling reconstruction formula, when can obtain calculating some target sampling point
Filter coefficient it is as follows:
Wherein, P is filter length, and according to specific hardware environment when realizing, P values can be chosen between 8~32
Value, L≤2N, N is phase accumulator digit, and the scope of index value is 0~(L-1).
(index k), is entered the filter factor h obtained according to calculating to the selected original sampling point of participation using below equation
Row filtering:
Correspondingly, with reference to Fig. 3, this application provides a kind of sample rate conversion equipment, including:Signal reconstruction controller 10,
Filter factor generator 20 and low pass filter 30.
Signal reconstruction controller 10, obtains original sampling frequency fs1With destination sample frequency fs2, obtain original series x
(n);According to original sampling frequency fs1With destination sample frequency fs2, target sequence is calculated on original series x (n) time dimension
Arrange relative position information index (n) of each target sampling point relative to the original sampling point of its nearest neighbours in y (n);Select to be used to calculate
The original sampling point of participation { x (Q), x (Q+1) ..., x (Q+P-1) } required for each target sampling point.
Filter factor generator 20, according to the relative position information index of each target sampling point, is calculated using formula (1-4)
The filter factor of each target sampling point, the filter factor is real-time generation, and the adaptability of filter factor is strong, sample rate conversion
Real-time preferably, can support the rational resampling of any multiple.
Low pass filter 30, according to the filter factor h (index, k), using formula (1-5) to selected original sample
Point is filtered, and exports each target sampling point, obtains target sequence y (n).
Wherein, signal reconstruction controller 10 includes again:DDS phase accumulators 11, relative position calculator 12, spilling number of times
Counter 13 and original sampling point selector 14.
DDS phase accumulators 11 are added up using frequency control word FTW as step value, and relative position calculator 12 often needs
When calculating a relative position information index (n), DDS phase accumulators 11 are accumulated once.
Relative position calculator 12 obtains original sampling frequency fs1With destination sample frequency fs2, according to original sampling frequency
fs1With destination sample frequency fs2, each target sampling point phase in target sequence y (n) is calculated on original series x (n) time dimension
For the relative position information index (n) of the original sampling point of its nearest neighbours.
Number of times counter 13 is overflowed when DDS phase accumulators 11 have often added up one time, counts phase in this cumulative process
Total spilling number of times Q of bit accumulator, the original sampling point of starting of original sampling point is participated in for adjusting, wherein, Q (n)=Q (n-1)+M,
M is spilling time numerical value when phase accumulator adds up every time.
Original sampling point selector 14, obtains original series x (n);Number of times Q is overflowed according to total, the company of selection in original series
Continuous P original sampling points as participating in original sampling point, wherein, participate in original sampling point with original sampling point X (Q) to originate original sample
Point, participates in original sampling point and is represented by { x (Q), x (Q+1) ..., x (Q+P-1) }.
It is pointed out that the application is according to original sampling frequency and destination sample frequency, dexterously in original series
On time dimension calculate target sequence in each target sampling point relative to the original sampling point of its nearest neighbours relative position information, according to
The relative position information, directly calculates filter factor required when obtaining each target sampling point in real time, and according to the relative position of calculating
Total spilling number of times that confidence is counted when ceasing, selects the original sampling point of required participation, then according to the filtering from original series
The original sampling point of participation of the coefficient to selection is filtered, and is reached the purpose of sample rate conversion, is realized signal reconstruction, such letter
Number reconstruct and need not between each sampling point of original series carry out vast scale interpolation, significantly increase sample rate conversion effect
Rate, the real-time of sample rate conversion preferably can support the rational resampling of any multiple.
Relative position information calculating process and target that liter sample rate conversion is changed with down-sampled rate are will be apparent from below
The operation principle of clear signal reconfigurable controller for the calculating process of sampling point position.
Fig. 5 rises sample rate transition diagram for the sample rate conversion equipment that the application is provided, now fs1<fs2.It is black in figure
Color black circle represents original series x (n) each original sampling point, and its sampling period is T1=1/fs1, two neighboring original sampling point
Phase difference be 2 π, the interpolated point number between two neighboring original sampling point is 2N, T1 is normalized to 2N;Solid five-pointed star table
Show target sequence y (n) each target sampling point, its sampling period is T2=1/fs2.In DDS 11 cycle accumulors of phase accumulator,
Reuse formula (1-2) and calculate relative position information.
When DDS phase accumulators 11 are often accumulated once, relative position calculator 12 determines that the position of a target sampling point,
Sample rate conversion equipment just exports a target sampling point.Specifically as shown in figure 5, DDS phase accumulators 11 are in A points, its phase value
Acc initial values are zero, and according to formula (1-2), index (1)=0, first point at this time exported is y (1);Afterwards, DDS phases
Bit accumulator 11 is added up using frequency control word FTW as step value, and DDS phase accumulators 11 successively reach B, C, D, E equipotential
Put, it is y (2), y (3), y (4), y (5) ... that target sampling point is determined successively.
Assuming that P=8 participates in original sampling points, it is necessary to select 8 in original sampling point x (n), in Figure 5 because of original sampling point
Initial point is x (1), selects QInitially=Q (1)=1.So,
When calculating y (1), index (1)=0, Q (1)=1, y (1) is overlapped with x (1);
When calculating y (2), DDS phase accumulators 11 do not overflow from A points to B points, the original sampling point nearest from y (2)
For x (1), index (2)=FTW, Q (2)=Q (1)+0=1, the selected original sampling point of participation is still with original sampling point x (1)
Originate original sampling point, participate in original sampling point for { x (1), x (2) ..., x (8) }, according to formula (1-5),
When calculating y (3), DDS phase accumulators 11 do not overflow from B points to C points, the original sampling point nearest from y (3)
For x (1), index (3)=2FTW, M=0, Q (3)=Q (2)+0=1, the selected original sampling point of participation is still with original sampling point
X (1) participates in original sampling point for { x (1), x (2) ..., x (8) } to originate original sampling point, according to formula (1-5),
When calculating y (4), DDS phase accumulators 11 have overflowed once from C points to D points, original are spanned on time dimension
Beginning sampling point x (2), the original sampling point nearest from y (4) is changed into x (2), index (4)=3FTW-2 from x (1)N, when this time cumulative
Overflow time numerical value M=1, Q (4)=Q (3)+1=2, Q value and add 1, the selected original sampling point of participation is with original sampling point x (2)
To originate original sampling point, therefore y (4) the original sampling point of participation is calculated for { x (2), x (3) ..., x (9) }, according to formula
(1-5),
The like, target complete sampling point can be calculated respectively, wherein, two adjacent target sampling points are on time dimension
With being spaced for cycle T 2, so that it is determined that target complete sampling point position, obtains target sequence y (n).
It should be noted that Q initial value can also be some negative value or zero, so that change the initial point of original sampling point,
For example, taking Q=-3, then, it is necessary to which the original series point used is x (- 3), x during these three points of calculating y (1), y (2) and y (3)
(- 2), x (- 1), x (0) ..., x (4) this 8 point (do not draw 0 moment and its point above) in figure, similarly, calculate y
(4), it is necessary to which the original sampling point used is then x (- 2), x (- 1), x (0), x (1) when ..., this 8 points of x (5).Here Q
Initial value is different, can influence to participate in the selection of original sampling point, so as to influence the target sequence y's (n) that sample rate exports after changing
Time domain specification and its spectral characteristic.Preferably, the selection principle of Q values is on time dimension, to make the original sampling point half of participation
Before the target sampling point, second half is after the target sampling point.
Fig. 6 is the down-sampled rate transition diagram of sample rate conversion equipment that the application is provided, now fs1>fs2.It is black in figure
Color black circle represents original series x (n) each original sampling point, and its sampling period is T1=1/fs1, two neighboring original sampling point
Phase difference be 2 π, the interpolated point number between two neighboring original sampling point is 2N;Solid five-pointed star represents target sequence y (n)
Each target sampling point, its sampling period be T2=1/fs2.In DDS 11 cycle accumulors of phase accumulator, formula (1- is reused
2) relative position information is calculated.
It is just true when DDS phase accumulators 11 are often accumulated once with liter sample rate conversion for a liter sample rate conversion
A fixed target sampling point, unlike, DDS phase accumulators 11 are cumulative every time, at least can all overflow once.
Specifically as shown in fig. 6, DDS phase accumulators 11 are in A points, its phase value Acc initial values are zero, according to formula (1-
2), index (1)=0, first point at this time exported is y (1);Afterwards, DDS phase accumulators 11 are with frequency control word FTW
Added up for step value, DDS phase accumulators 11 successively reach the positions such as B, C, then determine target sampling point y (2), y successively
(3)、…y(n)。
Assuming that P=8 participates in original sampling points, it is necessary to select 8 in original sampling point x (n), in figure 6 because of original sampling point
Initial point is x (1), selects QInitially=Q (1)=1.So,
When calculating y (1), index (1)=0, Q (1)=1, y (1) is overlapped with x (1);
When calculating y (2), DDS phase accumulators 11 have overflowed once from A points to B points, original are spanned on time dimension
Beginning sampling point x (2), the original sampling point nearest from y (2) is changed into x (2), index (2)=FTW-2 from x (1)N, overflowing when this time cumulative
Outdegree value M=1, Q (2)=Q (1)+1=2, Q value add 1, and the selected original sampling point of participation is with original sampling point x (2)
Originate original sampling point, therefore calculate y (2) the original sampling point of participation for { x (2), x (3) ..., x (9) }, according to formula (1-
5),
When calculating y (3), DDS phase accumulators 11 have overflowed once, spanned on time dimension from B points to C points again
Original sampling point x (3), the original sampling point nearest from y (3) is changed into x (3), index (3)=2FTW-2*2 from x (2)N, it is this time cumulative
When spilling time numerical value M=1, Q (3)=Q (2)+1=3, Q value add 1, the selected original sampling point of participation is with original sampling point x
(3) to originate original sampling point, therefore y (3) the original sampling point of participation is calculated for { x (3), x (3) ..., x (10) }, according to public affairs
Formula (1-5),
The like, y (1)~y (n) can be calculated respectively, wherein, between y (1)~y (n) adjacent target sampling point when
Between being spaced with cycle T 2 in dimension, so that it is determined that each target sampling point position.
Assuming that continuous time signal corresponding with original series x (n) is xr(t), innovation of the invention is:Not
Need to go first to reconstruct x by the method for vast scale filtering interpolation as prior artr(t) and then again from xr(t) extract and (adopt in
Sample) obtain target sequence y (n).The present invention is by designing a relative position calculator 12, and the calculator is in given primary condition
Afterwards, according to fs1And fs2Between relation calculate follow-up all target sampling points successively on a timeline relative to from current output
The relative position information of the nearest original sampling point of point, according to the positional information, further needed for the determination calculating target sampling point
The original sampling point of participation;Meanwhile, according to the positional information, by filter coefficient generator 20, generation calculates the output point institute in real time
The filter coefficient needed.
The present embodiment utilizes hardware chip, and such as FPGA or special ASIC can preferably realize, the present embodiment employs direct number
Phase-accumulated technology in word synthesis (Direct Digital Synthesizer, abbreviation DDS), according to target sequence and original
Sample frequency, directly synthesizes destination sample frequency, can preferably realize that sample rate is changed.
Embodiment two:
Sampling rate converting method in embodiment one also realizes that refer to Fig. 7, this application provides one kind using software
Sample rate conversion equipment, including:
Memory 40, for depositing program;
Processor 50, performs described program, for:According to original sampling frequency fs1With destination sample frequency fs2, in original
Each target sampling point is calculated in target sequence y (n) on beginning sequence x (n) time dimension relative to the original sampling point of its nearest neighbours
Relative position information;Selected in original series x (n) for calculating the original sampling point of participation required for each target sampling point;Root
According to the relative position information of each target sampling point, the filter factor of each target sampling point is calculated;According to the filter factor, to selected
The original sampling point selected exports target sampling point after being filtered, and obtains target sequence.
Wherein, the number for participating in original sampling point required for calculating each target sampling point is identical with the number of filter factor;
The number of filter factor corresponding to each target sampling point is determined according to the length P of wave filter, it is preferable that each target sampling point institute
The number of corresponding filter factor is equal with the length P of wave filter.
For convenience of calculation, the sampling period T1 of original series is normalized to 1, then, it can obtain calculating relative position
The reduced form for the formula (1-2) put:
Index'(n)=index'(n-1)+T2 (1-6a)
Wherein, index'(n) absolute time location information is represented, index (n) represents relative time locations information,Expression takes index'(n) integer part, initial value index'(1) be taken as zero.Counted first with formula (1-6a)
Calculate the absolute time location index'(n of n-th of target sampling point), then recycle formula (1-6b) calculate the target sampling point relative to
The relative time locations index (n) of a nearest original sampling point.At this time, index (n) represents a relative time values, without
It is phase value, 0≤index (n) < 1 again.
In another form, absolute location information is divided into integer part and fractional part, i.e. index'(n)=M+m, then m
=index (n), m just represent to take index'(n) fractional part, 0≤m < 1.
In fig. 5, it is assumed that y (1) the corresponding times are 0, T is made1=1, it is assumed that fs2/fs1=2.5, then T2=0.4, then aobvious
So, according to formula (1-6a), the corresponding index'(2 of y (2))=T2The corresponding index'(3 of=0.4, y (3))=2T2=0.8, y
(4) corresponding index'(4)=3T2=1.2.....
For y (2) and y (3),WithZero is equal to, and for y (4), is at this time hadAccording to formula (1-6b), relative time locations are respectively obtained:Index (1)=0, index (1)=
0.4, index (1)=0.8, index (1)=0.2 ...
Further, selected in original series x (n) for calculating the original sampling point of participation required for each target sampling point
When, selection is continuously used as the original sampling point of participation with the original sampling point of the equal length number of wave filter;In addition, according to index'
(n)=M+m, M value mean that index'(n) value exceed 1 number of times, therefore, be used for adjusting the original sampling point of participation using M values
Access scope, Q (n)=Q (n-1)+M selects former for calculating participation required for each target sampling point in original series
It is the original sampling point of starting with original sampling point X (Q) during beginning sampling point.
For example, with reference to Fig. 5, it is assumed that P=8 participates in original sampling points, it is necessary to select 8 in original sampling point x (n), in Figure 5
Because the initial point of original sampling point is x (1), Q is selectedInitially=Q (1)=1.So,
When calculating y (1), M=0, Q (1)=1, the selected original sampling point of participation are original to originate with original sampling point x (1)
Sampling point, participates in original sampling point for { x (1), x (2) ..., x (8) };
When calculating y (2), M=0, Q (2)=Q (1)+0=1, the selected original sampling point of participation is still with original sampling point x
(1) to originate original sampling point, original sampling point is participated in for { x (1), x (2) ..., x (8) };
When calculating y (3), M=0, Q (3)=Q (2)+0=1, the selected original sampling point of participation is still with original sampling point x
(1) to originate original sampling point, original sampling point is participated in for { x (1), x (2) ..., x (8) };
When calculating y (4), M=1, Q (4)=Q (3)+1=2, Q value adds 1, and the selected original sampling point of participation is with original
Sampling point x (2) calculates y (4) the original sampling point of participation for { x (2), x (3) ..., x (9) } to originate original sampling point;
The like, the original sampling point of participation for calculating y (1)~y (n) can be drawn respectively.
Either fs2> fs1Or fs2< fs1, utilize formula (1-6a), (1-6b) and index'(n)=M+m, it is possible to
Relative position of each target sampling point relative to the original sampling point of its nearest neighbours is determined, this following formula is then recycled,
Required filter coefficient is calculated in real time:
Obtain after filter coefficient, recycle following formula to be filtered the selected original sampling point of participation, calculate
Obtain corresponding target sampling point:
Here, m (n) represents the corresponding m values of n-th of output sample, 0≤m < 1;Q initial value can take positive number, 0 or
Some negative value.
Finally, then for the example of practical application sample rate switch technology of the present invention.
Assuming that there is a baseband signal, it is with a width of 3.84MHz, and its initial samples rate is fs1=15.36MHz is now logical
Sample rate switch technology of the present invention is crossed, the sample rate of the baseband signal is brought up into fs2=37.5MHz, then sample rate turns
Multiple is changed for fs2/fs1=2.3242, it is seen then that this sample rate changes multiple into a decimal, and decimal place is more, passes through
Traditional filtering interpolation and the method extracted are relatively difficult to realize this sample rate conversion.
Sample sample rate switch technology of the present invention, original series x (n) and the output sequence y (n) after sample rate conversion
As shown in figure 8, wherein, each small circle on dotted line represents that the asterisk point on original series x (n) each sampling point, solid line represents to adopt
Each sampling point of target sequence y (n) after the conversion of sample rate.
Fig. 9 show the corresponding spectrum diagram of former sequence x (n), and after being changed through over-sampling rate, Figure 10 show output
The spectrum diagram of target sequence.
It can be found by Fig. 9 and Figure 10 contrasts, using sample rate switch technology proposed by the invention, the frequency spectrum of output signal
Quality be it is extraordinary, that is, mirror image suppress ideal, and signal bandwidth can be consistent completely.
In summary, sample rate conversion or the conversion of down-sampled rate are either risen, each of output sequence y (n) is calculated
Target sampling point, is required to four steps:
1st, according to sample frequency fs1With destination sample frequency fs2Between relation calculate y (n) each target sampling point it is corresponding when
Between positional information index;Wherein, index calculating can use formula (1-2) or formula (1-6a) and (1-6b), wherein public
Formula (1-2) is more suitable within hardware as realized in PLD;Formula (1-6a) is more suitable in software with (1-6b)
Realize;
2nd, according to above-mentioned time location information index, the filter coefficient calculated required for the output point is produced in real time, can
To be calculated using formula (1-5) or formula (1-7);In addition, according to concrete application occasion, can select to filter coefficient
Windowing process is carried out, to improve the signal to noise ratio of output sequence after sample rate conversion;
3rd, according to total spilling number of times Q that number of times counter statistics is obtained is overflowed, select consistent with filter coefficient number
Original sampling point;
4th, processing is filtered to the original sampling point selected in step 3 using the filter coefficient produced in step 2, obtained
Corresponding target sampling point.
It will be understood by those skilled in the art that all or part of step of various methods can pass through in above-mentioned embodiment
Program instructs related hardware to complete, and the program can be stored in a computer-readable recording medium, storage medium can be wrapped
Include:Read-only storage, random access memory, disk or CD etc..For example, by program storage in the memory of equipment, when
When needing to carry out sample rate conversion, pass through computing device memory Program, you can realize above-mentioned steps.Especially in this hair
In bright actual implementation process, all or part in above-mentioned steps can be written as independent program, and the program is storable in service
Device, disk, CD, on flash disk, it is saved in by downloading in the memory of local device, or by downloading to local device
System carries out version updating, passes through computing device memory Program, you can realize all or part of work(in above-mentioned steps
Energy.
Above content is to combine the further description that specific embodiment is made to the application, it is impossible to assert this Shen
Specific implementation please is confined to these explanations.For the application person of an ordinary skill in the technical field, do not taking off
On the premise of from the present application design, some simple deduction or replace can also be made.
Claims (10)
1. a kind of sampling rate converting method, it is characterised in that including:
Obtain original sampling frequency and destination sample frequency;
Original series are obtained, the original series are the data sequences of the original sampling point composition obtained using original sampling frequency;
Relative position information calculation procedure, according to original sampling frequency and destination sample frequency, in the time dimension of original series
Each target sampling point is relative to the relative position information of the original sampling point of its nearest neighbours, each target sampling point in upper calculating target sequence
One relative position information of correspondence;
Original sampling point selects step, is selected in original series for calculating the original sample of participation required for each target sampling point
Point;
Filter factor generation step, according to the relative position information of each target sampling point, calculates the filtering of each target sampling point in real time
Coefficient;
Filter step, according to the filter factor, participates in exporting target sampling point after original sampling point is filtered, obtains to selected
To target sequence.
2. the method as described in claim 1, it is characterised in that the number of the original sampling point of participation required for each target sampling point
It is identical with the number of filter factor, the number and the equal length of wave filter of the filter factor corresponding to each target sampling point.
3. the method as described in claim 1, it is characterised in that relative position information calculation procedure includes:
A relative position information is often calculated, then the phase of phase accumulator is once tired out using frequency control word as step value
Plus, obtain the phase value of phase accumulator, the frequency control word and original sampling frequency and the ratio of destination sample frequency into
Direct ratio;
Relative position information is calculated using following calculation formula:
In formula, index represents relative position information, and mod (a, b) represents to take a to b modulus value;Round (s) represents to carry out four to s
House five enters to round;fs1For original sampling frequency;fs2For destination sample frequency;L is an integer, and meets L≤2N;Acc is
The phase value of phase accumulator, its initial value is zero;N is phase accumulator digit.
4. method as claimed in claim 3, it is characterised in that the original sampling point selection step includes:
The total of phase accumulator in this cumulative process is counted after phase accumulator adds up every time using number of times counter is overflowed
Number of times Q, Q (n)=Q (n-1)+M are overflowed, M is spilling time numerical value when phase accumulator adds up every time;
According to total spilling number of times Q, the original sample continuously with the equal length number of wave filter is selected in original series
Point is as original sampling point is participated in, and it is to originate original sampling point to participate in original sampling point with original sampling point X (Q).
5. the method as described in any one of claim 2 to 4, it is characterised in that the calculation formula of the filter factor is:
Wherein, P is filter length.
6. the method as described in claim 1, it is characterised in that be filtered using below equation:
7. a kind of sample rate conversion equipment, it is characterised in that including:
Signal reconstruction controller, obtains original sampling frequency and destination sample frequency;Original series are obtained, the original series are
The data sequence of the original sampling point composition obtained using original sampling frequency;According to original sampling frequency and destination sample frequency,
Each target sampling point in target sequence is calculated on the time dimension of original series relative relative to the original sampling point of its nearest neighbours
Positional information;Select for calculating the original sampling point of participation required for each target sampling point;
Filter factor generator, according to the relative position information of each target sampling point, calculates the filter factor of each target sampling point;
Low pass filter, according to the filter factor, exports target sampling point, obtains after being filtered to selected original sampling point
Target sequence.
8. device as claimed in claim 7, it is characterised in that the signal reconstruction controller includes:
DDS phase accumulators, are added up by step value of frequency control word, when relative position computer operation one time, phase
Bit accumulator is accumulated once, and the frequency control word is directly proportional to the ratio of original sampling frequency and destination sample frequency;
Relative position calculator, obtains original sampling frequency and destination sample frequency;Original series are obtained, the original series are
The data sequence of the original sampling point composition obtained using original sampling frequency;According to original sampling frequency and destination sample frequency,
Each target sampling point in target sequence is calculated on the time dimension of original series relative relative to the original sampling point of its nearest neighbours
Positional information;
Number of times counter is overflowed, phase accumulator is total in this cumulative process is counted after DDS phase accumulators are cumulative every time
Number of times Q, Q (n)=Q (n-1)+M are overflowed, M is spilling time numerical value when phase accumulator adds up every time;
Original sampling point selector, according to total spilling number of times Q, selects continuous P original sampling point conducts in original series
Original sampling point is participated in, it is the original sampling point of starting to participate in original sampling point with original sampling point X (Q).
9. a kind of sample rate conversion equipment, it is characterised in that including:
Memory, for depositing program;
Processor, for being realized by performing the program of the memory storage as any one of claim 1-6
Method.
10. a kind of computer-readable recording medium, it is characterised in that including program, described program can be executed by processor with
Realize the method as any one of claim 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710113085.8A CN106972840B (en) | 2017-02-28 | 2017-02-28 | Sampling rate conversion method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710113085.8A CN106972840B (en) | 2017-02-28 | 2017-02-28 | Sampling rate conversion method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106972840A true CN106972840A (en) | 2017-07-21 |
CN106972840B CN106972840B (en) | 2020-05-05 |
Family
ID=59328499
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710113085.8A Active CN106972840B (en) | 2017-02-28 | 2017-02-28 | Sampling rate conversion method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106972840B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110708070A (en) * | 2019-08-15 | 2020-01-17 | 北京航天驭星科技有限公司 | Resampling method and device |
CN112290907A (en) * | 2020-09-18 | 2021-01-29 | 天津理工大学中环信息学院 | Analog quantity filtering method and device based on embedded system |
CN115083427A (en) * | 2022-06-09 | 2022-09-20 | 珠海海奇半导体有限公司 | Audio resampling method, audio processing equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1126320C (en) * | 1997-02-26 | 2003-10-29 | 艾利森公司 | Sample rate converter |
JP2009141445A (en) * | 2007-12-04 | 2009-06-25 | Hitachi Ltd | Sampling rate converter and method for converting sampling rate |
CN103188186A (en) * | 2011-12-27 | 2013-07-03 | 安立股份有限公司 | Resampling processing device and method and digital modulation signal producing device |
CN104202016A (en) * | 2014-08-29 | 2014-12-10 | 哈尔滨工业大学 | Any times variable signal up-sampling implementation method and system based on look-up table method |
US20160087787A1 (en) * | 2014-09-19 | 2016-03-24 | Electronics And Telecommunications Research Institute | Sample rate converter and method of converting sample rate |
-
2017
- 2017-02-28 CN CN201710113085.8A patent/CN106972840B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1126320C (en) * | 1997-02-26 | 2003-10-29 | 艾利森公司 | Sample rate converter |
JP2009141445A (en) * | 2007-12-04 | 2009-06-25 | Hitachi Ltd | Sampling rate converter and method for converting sampling rate |
CN103188186A (en) * | 2011-12-27 | 2013-07-03 | 安立股份有限公司 | Resampling processing device and method and digital modulation signal producing device |
CN104202016A (en) * | 2014-08-29 | 2014-12-10 | 哈尔滨工业大学 | Any times variable signal up-sampling implementation method and system based on look-up table method |
US20160087787A1 (en) * | 2014-09-19 | 2016-03-24 | Electronics And Telecommunications Research Institute | Sample rate converter and method of converting sample rate |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110708070A (en) * | 2019-08-15 | 2020-01-17 | 北京航天驭星科技有限公司 | Resampling method and device |
CN112290907A (en) * | 2020-09-18 | 2021-01-29 | 天津理工大学中环信息学院 | Analog quantity filtering method and device based on embedded system |
CN112290907B (en) * | 2020-09-18 | 2022-07-01 | 天津理工大学中环信息学院 | Analog quantity filtering method and device based on embedded system |
CN115083427A (en) * | 2022-06-09 | 2022-09-20 | 珠海海奇半导体有限公司 | Audio resampling method, audio processing equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN106972840B (en) | 2020-05-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103166598B (en) | Digital filter and collocation method, electronic equipment and wireless communication system | |
CN104201991B (en) | Realize the digital down conversion system of frequency agility metre wave radar | |
CN102346245B (en) | Digital down-conversion method of broadband IF (intermediate frequency) signals | |
CN108427102B (en) | Radar baseband clutter generation device and method | |
CN111800091B (en) | Method for realizing digital down conversion and storage medium | |
CN106972840A (en) | A kind of sampling rate converting method and device | |
CN101458329A (en) | Time-domain paralleling sampling rate transformation method | |
CN106972832A (en) | It is a kind of can any multiple resampling digital down converter | |
CN108123684A (en) | A kind of Digital Down Convert processing method and equipment | |
CN110488228A (en) | Linear FM signal generation method, device and storage medium | |
CN108918965A (en) | Multi channel signals phase, amplitude high-precision measuring method | |
CN112350691A (en) | Geomagnetic weak signal detection algorithm based on multi-stage filtering extraction and two-stage WOLA structure | |
CN102891662B (en) | A kind of general rate down-conversion, up conversion device and method | |
CN106972833A (en) | It is a kind of can any multiple resampling digital up converter | |
CN106849904A (en) | Digital filtering equipment | |
EP2899935A1 (en) | Peak elimination device and method for multicarrier baseband | |
CN109474356B (en) | Broadband multi-channel signal energy detection system and method | |
CN102981156A (en) | Ultrasonic imaging post-processing method and device thereof | |
Ho et al. | Efficient algorithm for solving semi-infinite programming problems and their applications to nonuniform filter bank designs | |
CN110753013A (en) | Method and device for realizing USB telemetering signal down-sampling rate and electronic equipment | |
Salgado et al. | Power and area efficient comb-based decimator for sigma-delta ADCs with high decimation factors | |
CN110690909B (en) | Low-complexity dynamic non-uniform channelized user separation method | |
CN108121396B (en) | Selection method of variable fractional sampling rate | |
CN113376585A (en) | High-resolution pulse signal synthesizer | |
CN113872566B (en) | Modulation filtering device and method with continuously adjustable bandwidth |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 518000 Guangdong Province, Baoan District, Baoan District, Xin'an Street, Xingdong Community, 68 District, Antongda Industrial Factory Area, 4 factories, 3 floors, 5 office buildings, 1-3 floors Applicant after: Shenzhen dingyang Technology Co., Ltd Address before: Shenzhen City, Guangdong province Baoan District 518000 District 68 road left three Antongda Industrial Park, 4 floor Applicant before: SHENZHEN CITY SIGLENT TECHNOLOGIES Co.,Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |