How to build a circuit to determine the input sampling rate?

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
I'm using a Logitech Transporter.

It has two clock circuits. One running at 11.2896MHz and the other one at 24.576MHz. They correspond to the sampling rate of 44.1K and 48K based music playback.

Now I discover that the clocks are both running at all times. And I found that by disabling one clock (say the 24.576MHz one), the sound of redbook playback is significantly better. I believe the two clock circuits are interfering with each other via the Vcc and GND rails.

My question is, is there a way to build a circuit to detect the incoming sampling rate, so that I can use a relay to power on just one clock and leave the other clock powered off?
 
Open source microcontroller

I personally like the chipkit Uno32, it has a faster processor and more I/O pins and is cheaper.

I'm trying to avoid having two clocks with different freqs in the circuit loading on Vcc which produces asynchronous noise, and I certainly do not want another microcontroller with yet another clock loading on the Vcc line.

I'm hoping there is a simpler solution to this...:confused:
 
I'm trying to avoid having two clocks with different freqs in the circuit loading on Vcc which produces asynchronous noise, and I certainly do not want another microcontroller with yet another clock loading on the Vcc line.

I'm hoping there is a simpler solution to this...:confused:

Try adding to the decoupling. I had a similar problem with a USB board with noise on the 5 volt rail. A 470nF and 10uF sorted the problem.
 
Without getting into an issue about the decoupling, it should be possible to distinguish between the two clocks pretty easily.

First, I'd buffer both into counters to get lower frequencies to work with, although this is not absolutely necessary. Then I'd build a filter at each frequency. Then I'd use a simple diode detector to develop a DC level from the filtered input(s). Then I'd use comparators to produce logic level outputs when one or the other frequency was active.

Job done.
 
Without getting into an issue about the decoupling, it should be possible to distinguish between the two clocks pretty easily.

First, I'd buffer both into counters to get lower frequencies to work with, although this is not absolutely necessary. Then I'd build a filter at each frequency. Then I'd use a simple diode detector to develop a DC level from the filtered input(s). Then I'd use comparators to produce logic level outputs when one or the other frequency was active.

Job done.

If i read his initial post. BOTH clocks run at the same time!
 
If i read his initial post. BOTH clocks run at the same time!

I want to disable one of the clocks based on the input sampling rate. So only the clock for the intended sampling rate is active, and the power to the other clock will be disconnected.

I found that by disabling the XO that is not in used, the sonic improvement is rather large.

I'll give the decoupling caps a try, I have some 15uF OsCon and I'll parallel it with the existing ceramic, which I think is 0.1uF (will measure to find out).

But I know the best sonic quality is by disabling the unused XO, not by filtering caps or inductor filtering.
 
Without getting into an issue about the decoupling, it should be possible to distinguish between the two clocks pretty easily.

First, I'd buffer both into counters to get lower frequencies to work with, although this is not absolutely necessary. Then I'd build a filter at each frequency. Then I'd use a simple diode detector to develop a DC level from the filtered input(s). Then I'd use comparators to produce logic level outputs when one or the other frequency was active.

The incoming sample rates can be one of the followings:

44.1K, 48K, 88.2K and 96K. Obviously, the 44.1K and 88.2K belong to the same group with one clock, and the other two with the other clock.

Remember, when this circuit is running, only one of the clocks is active at the time, and it needs to determine the incoming sampling rate, and dynamically switch one of the two clock circuits on or off.
 
Decoupling does not work. I have a 15uF OsCon in parallel with a 0.1uF ceramic. Made no difference at all. Disabling power to one clock, viola, golden analog sound again!
You might need to cut the power trace to each clock and introduce a tiny resistance with the decoupling between the resistor and the oscillator.

I could be wrong, but if decoupling does not work then it seems probable that the power traces are too 'good' to allow you to prevent backflow of noise.

Another option might be to improve the ground at each oscillator, including the connection from the decoupling to ground.

Besides, it seems like you might have to cut the power trace anyway if you want to implement a switch to turn off each oscillator. Once you make that change to the circuit, you could experiment with better decoupling before resorting to the complicated rate detection and switching solution.

On that note, how do you plan on implementing the switch to turn on and off each oscillator? Will you remove them from the board entirely and use a daughterboard? ... or will you cut traces and leave the oscillators in place along with the added circuitry?
 
I removed the crystal driver IC and substituted it with a Silicon Labs Si530 XO. So no power trace cutting is necessary.

So are you suggesting I put something like a 10 ohm resistor b/w the decoupling caps and the Vcc of the XO?

How do I improve the ground to each oscillator? The two XOs are currently powered by a super regulator, right next to them.

If I were to install a switch, I'll put a small relay next to the XOs. The relay will control the power and/or ground pins to the XOs. A switch will turn on and turn off the relay by connecting the relay's coil to 5V.

Ultimately, I'd want a circuit to detect the incoming sampling rate, and fire that relay on and off automatically.
 
I removed the crystal driver IC and substituted it with a Silicon Labs Si530 XO. So no power trace cutting is necessary.
I'm flying blind here, so can you tell me the part number for the crystal driver IC that you removed? Is it pin-compatible? My friend has a Squeezebox, but not the Transporter, so I can't get an easy look inside.

So are you suggesting I put something like a 10 ohm resistor b/w the decoupling caps and the Vcc of the XO?
I would suggest less resistance: 0.1 Ω or whatever the smallest you can buy (SMD). Put the resistor between the decoupling cap and the supply, but connect the decoupling cap directly to the Vcc of the XO. The decoupling cap will eventually charge up to the full supply voltage, but the resistor will allow the noise to stay separate. You could even select the resistance and decoupling capacitance based upon the frequency of the noise that you see (got a frequency analyzer?) and tune the RC filter accordingly.

My hunch is that if the supply has lots of noise and you didn't have luck filtering it out with a normal decoupling cap, then perhaps the supply traces are too strong. Adding the tiny resistance separates your XO Vcc from the supply, and allows the decoupling cap to filter it more. But, this all assumes that the noise is actually coming through the supply traces and not via EMI.

How do I improve the ground to each oscillator? The two XOs are currently powered by a super regulator, right next to them.
There should be a ground plane and the regulators should be attached to the ground with thick traces and/or vias. I recently read an article about how decoupling works, and it might help.

http://www.intersil.com/data/an/an1325.pdf

There's potentially another reference that a friend mentioned, so I'll ask if he can help dig that up.

If I were to install a switch, I'll put a small relay next to the XOs. The relay will control the power and/or ground pins to the XOs. A switch will turn on and turn off the relay by connecting the relay's coil to 5V.
You might be able to use FET switches instead of a relay. Either discrete transistors or something like the NXP SN74HC4066 (quad) or even the tiny Fairchild NC7SZ66P5X (single).

The nice side-effect of using an FET switch is that the on resistance can serve as part of the RC filtering on the supply as I suggested above. Just make sure the decoupling cap is on the cold side of the FET switch next to the XO.

Ultimately, I'd want a circuit to detect the incoming sampling rate, and fire that relay on and off automatically.
Yes, that would be convenient, especially if you can find an existing trace on the Transporter PCB that already indicates this.

By the way, I can't guarantee that any of the above would work. Sometimes I can look at someone else's design and see mistakes, bad design choices, or even something as simple as picking the wrong part for the job. But other times there's no obvious reason why a product doesn't work as well as it should, and in this case I haven't even looked at the Transporter. Anyway, I hope you'll just take these as suggestions, not The Gospel Truth.
 
I'm flying blind here, so can you tell me the part number for the crystal driver IC that you removed? Is it pin-compatible? My friend has a Squeezebox, but not the Transporter, so I can't get an easy look inside.

I don't know the original p/n for the crystal generator IC. I think it is likely to be something pin compatible with the 74LVC1GX04, the pins are exactly the same as this IC.

I would suggest less resistance: 0.1 Ω or whatever the smallest you can buy (SMD). Put the resistor between the decoupling cap and the supply, but connect the decoupling cap directly to the Vcc of the XO. The decoupling cap will eventually charge up to the full supply voltage, but the resistor will allow the noise to stay separate. You could even select the resistance and decoupling capacitance based upon the frequency of the noise that you see (got a frequency analyzer?) and tune the RC filter accordingly.

The noise I'm trying to filter is exactly the freq of the XO. I found that once the XO is powered on, the Vcc gets polluted and it interferes with the other XO that is in use. In the case of the Transporter, both clock circuits are powered by a 3-pin 3.3V linear regulator. The problem with all these Squeezebox designs is that they have both clocks running all the times, and that's the problem with the sonic degradation. They should cut the power to the clock circuit that is not in use. FWIW, I've already replaced the 5V SMPS with a super regulator powered LPS.


You might be able to use FET switches instead of a relay. Either discrete transistors or something like the NXP SN74HC4066 (quad) or even the tiny Fairchild NC7SZ66P5X (single).

The nice side-effect of using an FET switch is that the on resistance can serve as part of the RC filtering on the supply as I suggested above. Just make sure the decoupling cap is on the cold side of the FET switch next to the XO.

I thought of using a transisor as well. What's the advantage of using a FET instead of a bipolar transistor?

Yes, that would be convenient, especially if you can find an existing trace on the Transporter PCB that already indicates this.

That will be the next part of this project once I found the way to do the sample rate detection.
 
Last edited:
Is there a discrete mux in the unit somewhere which selects between the two oscillator outputs?

There is a Xilinx chip in which the clock traces go into. This is the chip where the clock freq selection is made.

See attached pic for the TP clock circuit. It is a simple Pierce oscillator.

TransporterClock-2.jpg
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.