1. Technical Field
The present invention relates to a sampling frequency converter that is suitable for use in a digital audio device.
2. Related Art
As this kind of sampling frequency converter, there is a known converter that provides data after sampling frequency conversion to a subsequent stage device via a FIFO (First-In First-Out buffer), or there is a known converter that obtains data before sampling frequency conversion from a preceding stage device.
In the sampling frequency converter illustrated in
The control unit 103 also monitors the number of effective data, which is the number of unread data that is received from the interpolator 101 and stored in the FIFO 102 but has not yet been outputted to a subsequent stage device, and performs correction of the frequency control information based on this number of effective data. More specifically, when the speed of writing data to the FIFO 102 becomes faster than the speed of reading data from the FIFO 102, and the number of effective data increases to become greater than a specified reference value, the control unit 103 generates a negative correction value as illustrated in
In the sampling frequency converter illustrated in
The control unit 106 also monitors the number of effective data, which is the number of unread data that is received from a preceding stage device and stored in the FIFO 104 but has not yet been outputted to a subsequent stage device, and performs correction of the frequency control information based on this number of effective data. Furthermore, as will be described in detail later, when the speed of reading data from the FIFO 104 becomes less than the speed of writing data to the FIFO 104, and the number of effective data increases to become greater than a specified reference value, the control unit 106 generates a positive correction value in order to increase the frequency control information, and increases the speed of reading from the FIFO 104. On the other hand, when the speed of reading data from the FIFO 104 becomes greater than the speed of writing data to the FIFO 104, and the number of effective data decreases to become less than a specified reference value, the control unit 106 generates a negative correction value in order to decrease the frequency control information, and reduces the speed of reading from the FIFO 104. In the sampling frequency converter illustrated in
Incidentally, in the sampling frequency converter illustrated in
However, in the sampling frequency converter illustrated in
In consideration of the situation described above, the object of the present invention is to provide a sampling frequency converter that is capable of keeping frequency fluctuation of data after sampling frequency conversion low, and reducing latency of sampling frequency conversion.
A preferred form of the present invention is a sampling frequency converter, comprising: a buffer that, in response to a write request signal, stores data newly inputted to the buffer, and in response to a read request signal, reads and outputs stored data in order from the oldest one of the stored data; an interpolation unit that sequentially receives data, performs an interpolation operation at a generation timing at which a write request signal is generated for calculating interpolated data corresponding to the generation timing of the write request signal from a specified number of the most recently received data up to the generation timing of the write request signal, and supplies the interpolated data to the buffer; a writing speed adjusting unit that recurrently generates a write request signal at a time rate determined according to frequency control information, thereby causing the interpolation unit to execute the interpolation operation responsibly to the write request signal, and causing the buffer to store the data outputted from the interpolation unit responsibly to the write request signal; a speed correction pointer that increases a pointer value when a write request signal is generated, and decreases the pointer value when a read request signal is generated; and a frequency control unit that corrects the frequency control information based on the pointer value of the speed correction pointer.
With this form of the invention, control is performed such that the frequency control information is corrected according to an increase or decrease in the pointer value of the speed correction pointer, and the writing speed follows the reading speed. Therefore, adjustment of the writing speed over a wide range, and fine adjustment of the writing speed near the reading speed can be performed according to an increase or decrease in the pointer value of the speed correction pointer without increasing the number of stages of the buffer. Consequently, it is possible to reduce frequency fluctuation of data after sampling frequency conversion without latency of the sampling frequency conversion becoming large.
Another preferred form of the present invention is a sampling frequency converter, comprising: a buffer that, in response to a write request signal, stores data newly inputted to the buffer, and in response to a read request signal, reads and outputs stored data in order from the oldest one of the stored data; an interpolation unit that sequentially receives data from the buffer, performs an interpolation operation at a generation timing at which a read request signal is generated for calculating interpolated data corresponding to the generation timing of the read request signal from a specified number of the most recently received data up to the generation timing of the read request signal, and outputs the interpolated data; a reading speed adjusting unit that recurrently generates a read request signal at a time rate determined according to frequency control information, thereby causing the buffer to output data to the interpolation unit responsibly to the read request signal, and causing the interpolation unit to execute the interpolation operation responsibly to the read request signal; a speed correction pointer that increases a pointer value when a write request signal is generated, and decreases the pointer value when a read request signal is generated; and a frequency control unit that corrects the frequency control information based on the pointer value of the speed correction pointer.
With this form of the invention, control is performed such that the frequency control information is corrected according to an increase or decrease in the pointer value of the speed correction pointer, and the reading speed follows the writing speed. Therefore, adjustment of the reading speed over a wide range, and fine adjustment of the reading speed near the writing speed can be performed according to an increase or decrease in the pointer value of the speed correction pointer without increasing the number of stages of the buffer. Consequently, it is possible to reduce frequency fluctuation of data after sampling frequency conversion without latency of the sampling frequency conversion becoming large.
In the following, embodiments of the present invention will be explained with reference to the accompanying drawings.
An 8-times up-sampler 2 is a circuit that performs 8-times up sampling of the audio data having the first sampling frequency that is outputted from the anti-aliasing LPF 1, and outputs the result as audio data having a sampling frequency of 384 kHz. A 1/L down-sampler 3 is a circuit that uses linear interpolation to perform 1/L down sampling of the audio data having a 384 kHz sampling frequency that was outputted from the 8-time up-sampler 2, and outputs audio data having the second sampling frequency. Determining the factor at which the down sampling is performed is set according to the selected second sampling frequency.
A FIFO 4 is a first-in first-out buffer that stores the audio data having the second sampling frequency that is outputted from the 1/L down-sampler 3, and sequentially outputs the stored audio data starting from the oldest data according to a FIFO read request signal. A serial interface 5 is a circuit that performs control for supplying audio data having the second sampling frequency to a subsequent stage device. A data request signal LRCK, having the same frequency as the second sampling frequency, and a bit clock BCLK are supplied to the serial interface 5 from the subsequent stage device. After being supplied with a data request signal LRCK, the serial interface 5 supplies a FIFO read request signal to the FIFO 4 and writing speed adjusting circuit 6, converts the audio data that is outputted from the FIFO 4 to serial data SDO according to the signal LRCK, synchronizes each bit of the serial data SDO with the bit clock BCLK and supplies the result to the subsequent stage device.
A speed correction pointer 8 is a pointer that is incremented when a FIFO write request signal occurs, and is decremented when a FIFO read request signal occurs. The writing speed adjusting circuit 6 is a circuit that has the same time rate as the average time rate at which the FIFO read request signal is generated, generates a FIFO write request signal that is synchronized with a 384 kHz main clock φ, and outputs that signal to the FIFO 4 and a linear interpolation coefficient generating circuit 7. More specifically, the writing speed adjusting circuit 6 generates phase information in synchronization with the main clock φ by accumulating frequency control information according to the second sampling frequency, and every time this phase information overflows, generates a FIFO write request signal. The linear interpolation coefficient generating circuit 7 is a circuit that finds a linear interpolation coefficient from the phase information at the timing when a FIFO write request signal occurs, and supplies that coefficient to the 1/L down-sampler 3.
The writing speed adjusting circuit 6 of this embodiment has the function of correcting frequency control information according to the pointer value of the speed correction pointer 8, and adjusting the time rate or time density at which the FIFO write request signal occurs. More specifically, when the speed of writing to the FIFO 4 becomes greater than the reading speed, and the pointer value of the speed correction pointer 8 becomes greater than the reference value, the writing speed adjusting circuit 6 generates a negative correction value that decreases the frequency control information, reduces the time rate at which the write request signal is generated, and decreases the writing speed. On the other hand, when the speed of writing to the FIFO 4 becomes less than the reading speed, and the pointer value of the speed correction pointer 8 becomes less than the reference value, the writing speed adjusting circuit 6 generates a positive correction value that increases the frequency control information, increases the time rate at which the write request signal is generated, and increases the writing speed. By performing this kind of control, the writing speed follows the reading speed.
The writing speed adjusting circuit 6 of this embodiment also has a conversion table that converts the pointer value of the speed correction pointer 8 to a correction value that increases or decreases the frequency control information. In this conversion table, the slope of the change in the correction value with respect to the change in the pointer value of the speed correction pointer 8 becomes small in the region near the reference value, and as the pointer value separates from the reference value, the change in the correction value with respect to the change in the pointer value becomes large. By performing non-linear conversion using this kind of conversion table on the pointer value of the speed correction pointer 8 and generating a correction value or correction amount, a correction amount having a large absolute value is generated in the area where the speed of writing to the FIFO 4 is far deviated from the reading speed, which quickly brings the writing speed close to the reading speed, and in the area where the writing speed approaches the reading speed, a correction amount having a small absolute value is generated for correcting small shifts of the writing speed from the reading speed, thus making it possible to stabilize the writing speed and match the writing speed with the reading speed.
As described above, with this embodiment, instead of being based on the number of effective data, the speed of writing to the FIFO 4 is adjusted based on a pointer value of a speed correction pointer 8 that is incremented each time a write request signal is generated and is decremented each time a read request signal is generated. Therefore, it is possible to keep the number of stages in the FIFO 4 at the minimum number required for absorbing jitter, and latency of sampling frequency conversion can be reduced. Moreover, with this embodiment, by generating a correction amount from a pointer value of a speed correction pointer 8 using the non-linear conversion described above, in addition to adjusting the writing speed of the FIFO 4 over a wide range, it is possible to perform fine adjustment of the writing speed in a range where the writing speed is near the reading speed. Therefore, frequency fluctuation in data after sampling frequency conversion can be reduced without increasing latency of the sampling frequency conversion. Furthermore, with this embodiment, FIFO write request signals are controlled so that they are periodically generated at the same time rate as FIFO read request signals, and are generated at a timing that is synchronized with the main clock φ. Therefore, even though there may be jitter in the timing for generating the data request signal LRCK and FIFO read request signal, audio data having the second sampling frequency is generated by the 1/L down-sampler 3 and supplied to a subsequent stage device via the FIFO 4 and serial interface 5 without being affected by the jitter. The above is a summary of this embodiment.
First, the 1/L down-sampler 3 will be explained. In
A subtractor 33, a multiplier 34, an adder 35 and a register 36 form a means for performing interpolation operation to find interpolated audio data having the second sampling frequency from the audio data A and B, and for outputting the result. Under timesharing control, and during a period from a time when a FIFO write request signal is generated until the next FIFO write request signal is generated, these circuits perform interpolation to find audio data having the second sampling frequency for each of the L channel and R channel, and supply the results to the FIFO 4 via the register 36.
More specifically, the subtractor 33 subtracts audio data A that is stored in the register 32a of the operation data storage unit 32 from audio data B of the L channel that is stored in the register 32b, and outputs the resulting data B−A. The multiplier 34 multiplies data B−A by a linear interpolation coefficient α that is outputted at that time from the linear interpolation coefficient generating circuit 7, and outputs the data (B−A)×α. Here, α is numerical value that indicates a position of audio data having the second sampling frequency that is to be found by interpolation on the time axis between audio data A and audio data B. The method used for calculating the linear interpolation coefficient α will be described later. The adder 35 adds the data (B−A)×α that is obtained from the multiplier 34 and the audio data A of the L channel that is stored in the register 32a of the operation data storage unit 32. The register 36 holds the result of adding A+(B−A)×α as the audio data of the L channel having the second sampling frequency. An example of processing by the subtractor 33, multiplier 34, adder 35 and register 36 for the L channel has been explained above, however, the same processing is executed for the audio data of the R channel, and the results are held in the register 36.
Next, the writing speed adjusting circuit 6 will be explained with reference to
A vector detection circuit 604 is a circuit that monitors the pointer value of the speed correction pointer 8, and outputs vector up/down information indicating which of the following applies to the change mode over time of the pointer value.
a. The pointer value is increasing.
b. The pointer value is decreasing.
c. The pointer value changed from increasing to decreasing.
d. The pointer value changed from decreasing to increasing.
A frequency control unit 610 provides a means for generating frequency control information Δy that sets the frequency of a FIFO write request signal. A write request signal generating unit 620 is a circuit that accumulates the total frequency control information Δy each time the main clock φ is generated, and generates a FIFO write request signal each time phase information y, which is the accumulated total value, overflows. The construction of these circuits will be described in order below.
First, the frequency control unit 610 is composed of a ΔT table 611, an adder 612, a latch 613 and an addition value table 614. The addition value table 614 stores the initial values for frequency control information Δy that is correlated with various kinds of second sampling frequencies. When the accumulation of frequency control information by the write request signal generating unit 620 is repeated in synchronization with the 384 kHz main clock φ, this frequency control information Δy takes on a value such that phase information y, which is the accumulated value, overflows at a time rate that corresponds to the second sampling frequency. More specifically, when the phase information y is taken to be a value within the range 0 to M−1, and the second sampling frequency is taken to be f2, the initial value of the frequency control information Δy is then taken to be value as given below.
The latch 613 is operated such that it can be initialized. When the sampling frequency converter starts operation, the frequency control information Δy that is correlated with the second sampling frequency f2 requested by a subsequent stage device is read from the addition value table 614, and the latch 613 is initialized to that value. After that, each time the 384 kHz main clock φ is generated, the frequency control information Δy in the latch 613 is updated with the output data from the adder 612.
When the pointer value of the speed correction pointer 8 deviates from a reference value because the frequency control information Δy that is outputted from the latch 613 is improper, the ΔT table 611 and the adder 612 form a way of correcting the frequency control information Δy to a proper value. First, the ΔT table 611 is a table for converting the combination of the pointer value of the speed correction pointer 8 and the vector UP/DOWN to a correction amount ΔT.
As illustrated in
The write request signal generating unit 620 is composed of an adder 621 and latch 622. The adder 621 adds the frequency control information Δy that is supplied from the frequency control unit 610 and the current phase information y that is outputted from the latch 622. Each time the main clock φ is supplied, the latch 622 obtains and holds the output data from the adder 621 as new phase information y.
In
α=β/(M/L)
In this equation, the M/L value used is a value from among the initial values M/L of the frequency control information Δy stored in the addition value table 614 that corresponds to the second sampling frequency requested by a subsequent stage device.
The 1/L down sampler 3 uses the linear interpolation coefficient α that was obtained in this way to perform linear interpolation between data A and B of audio data having the second sampling frequency, and writes the audio data that is obtained from this interpolation to the FIFO 4.
With the sampling frequency converter explained above, the speed of writing to the FIFO 4 is adjusted based on the pointer value of the speed correction pointer 8 that is incremented when a FIFO write request signal is generated and is decremented when a FIFO read request signal is generated instead of the number of effective data of the FIFO 4. Therefore, control of the writing speed over a wide range, and fine adjustment of the writing speed near the reading speed can be performed according to an increase or decrease in the pointer value of the speed correction pointer 8. Therefore, the number of stages of the FIFO 4 can be set to the minimum number required to absorb jitter, and it is possible to reduce latency of sampling frequency conversion, while at the same time reduce frequency fluctuation in data after sampling frequency conversion. Moreover, with this embodiment, a FIFO write request signal having the same time rate as the average time rate of a FIFO read request signal is generated in synchronization with the main clock φ. The linear interpolation coefficient α used in the linear interpolation operation is calculated using phase information y at the timing of generating a FIFO write request signal that is synchronized with the main clock φ. Therefore, with this embodiment, even when there is jitter at the timing of generating a data request signal LRCK and FIFO read request signal, audio data having the second sampling frequency can be generated and supplied to a subsequent stage device without being affected by the jitter.
In more detail, in response to a write request signal, the FIFO 4 stores audio data having a first sampling frequency that is outputted from the 8-times up sampler 2 and outputs the stored audio data in order starting from the oldest one. The speed correction pointer 8 is a pointer that is incremented when a FIFO write request signal is generated, and is decremented when a FIFO read request signal is generated.
A reading speed adjusting circuit 9 is a circuit that generates a FIFO read request signal that has the same time rate as the average time rate at which a FIFO write request signal is generated and that is synchronized with a 384 kHz main clock φ, and outputs that signals to the FIFO 4 and linear interpolation coefficient generating circuit 7. More specifically, the reading speed adjusting circuit 9, in synchronization with a main clock φ, generates phase information by accumulating frequency control information according to a second sampling frequency, and generates a FIFO read request signal every time that phase information overflows. A linear interpolation coefficient generating circuit 7 then finds a linear interpolation coefficient from the phase information at the timing of generating the FIFO read request signal, and supplies the coefficient to the 1/L down sampler 3.
The reading speed adjusting circuit 9 of this embodiment has a function of increasing or decreasing frequency control information according to the pointer value of a speed correction pointer 8, and adjusting the time rate or time density at which FIFO read request signals are generated. In more detail, when the speed of reading from the FIFO 4 becomes greater than the writing speed, and the pointer value of the speed correction pointer 8 becomes less than a reference value, the reading speed adjusting circuit 9 generates a negative correction amount that decreases the frequency control information, which decreases the time rate at which read request signals are generated, and reduces the reading speed. On the other hand, when the speed of reading from the FIFO 4 becomes less than the writing speed, and the pointer value of the speed correction pointer 8 becomes greater than a reference value, the reading speed adjusting circuit 9 generates a positive correction amount that increases the frequency control information, which increases the time rate at which read request signals are generated, and increases the reading speed. With this kind of control, the reading speed follows the writing speed.
Moreover, the reading speed adjusting circuit 9 of this embodiment has a conversion table that converts the pointer value of the speed correction pointer 8 to a correction amount that increases or decreases the frequency control information. As in the first embodiment above, in this conversion table the slope of the change in the correction amount with respect to the change in the pointer value of the speed correction pointer 8 is small near the reference value, and as the pointer value separates away from the reference value, the slope of the change in the correction amount with respect to the change in the pointer value of the speed correction pointer 8 become large. Therefore, with this embodiment, in the area where the speed of reading from the FIFO 4 is separated away from the writing speed, a correction amount having a large absolute value is generated, which causes the reading speed to quickly approach the writing speed, and in the area where the reading speed is near the writing speed, a correction amount having a small absolute value is generated for the small deviation of the reading speed from the writing speed, which can stabilize the reading speed and cause the reading speed to match the writing speed.
Therefore, with this embodiment, the same effect as in the first embodiment can be obtained.
First and second embodiments of the present invention were explained above, however, in addition to these embodiments, other embodiments are possible for the present invention. For example, in each of the embodiments above, 8-times up sampling was performed for input audio data having a first sampling frequency, and after being converted to 384 kHz audio data, audio data having a second sampling frequency was generated by performing 1/L down sampling, however, instead of performing 8-times up sampling, it is possible to perform high-order interpolation as 1/L down sampling.
Number | Date | Country | Kind |
---|---|---|---|
2010-192064 | Aug 2010 | JP | national |