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.
Kuro

It is interesting that such an issue got by the manufacturer, but....
Switching clocks is possible but does have numerous issues, just to name a few:

Must ensure the clock is available when it is first needed

Downstream parts relying on the clock (either) usually require a reset after the clock has been switched or you must garuntee that the new clock still meets the set-up and hold times when crossing from one to the other clocks. (this issue can sometimes be neglected and one lives with a chance of a error)

The oscillator usually takes a few milliseconds to reach its stable rated frequency. And longer to reach its thermal equilibrium.

A few other things to look at:
It might be that the Zilincs part needs more decoupling.
Possible ringing on the oscillators outputs to the Zilincs input, at least one trace looks short the other has some length to it. Some series resistance on the osc driver output (small so as to not slow down the rise time and effect jitter) may reduce the ringing (need a low cap probe to see if this is even an issue). This would make things worse if the effect were from magnetic coupling via the trace proximity.

Thanks
-Antonio
 
Magnoman,

This is actually a very typical issue by many manufacturers. They just leave all the XOs running, whether they are in use or not.

Looks like you're right about the downstream parts needing the clock. I played a song that is recorded at 24/96 without the XO in place. After that, I cannot play anything at any sample rate again! Looks like the "lost" clock signal will require some kind of reset, in this case, I need to cycle the power.

So it is hard to say if switching clock on/off within milliseconds will even work at all...

Looks like I'm back to some decoupling strategy again :(
 
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.

So basically you can build an analog detector to detect the fundamental of any of these incoming using roughly the techniques I described. It'll be ugly, but it'll work and it won't use a uProc. You may have to **** with it a bit, chose which signal you're going to monitor amongst data and l/r clock or WHY, there'll be energy at the harmonics but the majority will be at the fundamental. First discriminate between 44k1/88k2 and 48/96 then sort out what you have left.

edit: sorry, didn't see some of the later posts until I had written this...
 
Last edited:
Thanks for the photo of the PCB. It's probably not a huge issue, but you appear to have created a couple of cold solder joints when you restored the crystal on the left. You might want to fix that up when you're done changing things.

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.
Note that you might not be getting the full performance out of the super regulator. Power circuits require low impedance connections, and a good regulator can perform poorly if there are high current demands along with high impedance connections.

As others have suggested in this thread, it seems best that you avoid turning off either oscillator, but instead focus on isolating each crystal with a good filter. I think my suggestion of an RC filter is worth trying. If anyone else has suggestions (beyond just adding a bypass capacitor, which has already been tried), then please chime in.

By the way, did you read that article I linked about choosing a bypass capacitor? Maybe your previous attempt at adding decoupling failed due to the cap selected, not because the concept won't work with the right cap.

I thought of using a transisor as well. What's the advantage of using a FET instead of a bipolar transistor?
For me, an FET is easier to design with, because it works more like a digitally-controlled switch. No biasing resistors are needed, unlike bipolar. Also, an FET can conduct signals in both directions from source to drain, whereas a bipolar is unidirectional (not that you necessarily need this here). Finally, chips like the 4066 use FETs internally to implement their analog switches, and so I usually use a discrete FET to create the same thing.
 
Lots of great suggestions clipped

Possible ringing on the oscillators outputs to the Zilincs input, at least one trace looks short the other has some length to it. Some series resistance on the osc driver output (small so as to not slow down the rise time and effect jitter) may reduce the ringing (need a low cap probe to see if this is even an issue). This would make things worse if the effect were from magnetic coupling via the trace proximity.
There may already be some series resistance on the oscillator circuits. If you look at the photo, there is an SMD crystal can, two SMD capacitors, and then what I think is an SMD resistor between the caps and below the driver chip. Then again, I suppose you may be suggesting a new series resistance between the driver chip outputs and the Xylinx inputs - that's certainly worth trying.

A good step now would be to grab the data sheet for the exact Xylinx part and see what the equivalent input circuit looks like, particularly with regard to parasitic capacitance.
 
Thanks for the photo of the PCB. It's probably not a huge issue, but you appear to have created a couple of cold solder joints when you restored the crystal on the left. You might want to fix that up when you're done changing things.

That's the pic before I started with the mods. The bad solder joints on the left x'tal were there to begin with. And I'm not using the x'tals anymore, as I've replaced them with low phase noise XOs.


Note that you might not be getting the full performance out of the super regulator. Power circuits require low impedance connections, and a good regulator can perform poorly if there are high current demands along with high impedance connections.

I merely replaced the 3-pin 3.3V linear reg you see in the middle with a super reg. I found that the XOs does perform better with lower supply noise (presumbly lower jitter is the result), and thus it does sound better with the super reg (greater instrument separation and clarity).

By the way, did you read that article I linked about choosing a bypass capacitor? Maybe your previous attempt at adding decoupling failed due to the cap selected, not because the concept won't work with the right cap.

Yes I read it. It seems that I need to use a 10uF // 0.1uF or 1uF // 0.01uF or 10uF // 0.1uF // 0.01uF. And I should use different SMD sizes on the caps to achieve the desired result according to the article.


Finally, chips like the 4066 use FETs internally to implement their analog switches, and so I usually use a discrete FET to create the same thing.

I read the datasheet on 4066, the impedance with device on is around 150 ohms. Wouldn't it be too large for use to power the XOs?
 
There may already be some series resistance on the oscillator circuits. If you look at the photo, there is an SMD crystal can, two SMD capacitors, and then what I think is an SMD resistor between the caps and below the driver chip. Then again, I suppose you may be suggesting a new series resistance between the driver chip outputs and the Xylinx inputs - that's certainly worth trying.

A good step now would be to grab the data sheet for the exact Xylinx part and see what the equivalent input circuit looks like, particularly with regard to parasitic capacitance.

The clock oscillator circuit in the Transporter is this one:

Pierceoscillator2.png


The values are only there for illustration purpose. But the actual implementation does not have resistor Rs. Rs is needed to prevent over driving the x'tal. I suppose the designer thinks it is not needed due to the impedance of the unbuffered CMOS inverter.

Resistor RF is 10M ohm (I think) on the actual circuit. This value can be anywhere from 1M-10M ohm and it supposed to be not very important.
 
If I had to free-run both clocks I probably could not resist putting in separate regulators for each and making sure the grounds are well 'starred'.

Also, it's not too hard to make a lower noise frontend for the oscillator with a bipolar transistor. The output buffer wll still draw switching spikes from the supply, which is why I'd put in two.
 
Last edited:
If I had to free-run both clocks I probably could not resist putting in separate regulators for each and making sure the grounds are well 'starred'.

Which regulator would you recommend? I'm using two Si530 XOs, unlike a typical XO, it has already got a built-in regulator. It does have less interference compared to a Crystek C3391 XO mixed with a Si530 XO in the same circuit.
 
I read the datasheet on 4066, the impedance with device on is around 150 ohms. Wouldn't it be too large for use to power the XOs?
That's a typical number for the original 4066 design from decades ago. One of the parts that I suggested in my response has 0.4 Ω. It's also very tiny in comparison to a 14-pin quad switch.

When selecting a discrete FET, you would certainly look for a lower on resistance, unless your RC filter would work better with a higher resistance.
 
The clock oscillator circuit in the Transporter is this one:

Pierceoscillator2.png


The values are only there for illustration purpose. But the actual implementation does not have resistor Rs. Rs is needed to prevent over driving the x'tal. I suppose the designer thinks it is not needed due to the impedance of the unbuffered CMOS inverter.
I could be wrong, but I believe that Rs also makes the crystal waveform into more of a sine wave, thus potentially reducing EMI. I am in the process of designing a DSP board, and I recently added the equivalent of Rs after reading the finer details in the data sheets for the processor. Clearly, in my case, Rs was not needed because earlier revisions of the board 'worked' just fine. But my thought in adding it in my present revision is to reduce noise. I haven't had a chance to connect the 'scope to that pin to compare old versus new, however.

I get the impression that a lot of these circuit components are not absolutely necessary for a basic, minimally functional board. However, adding them can reduce noise if the right values are chosen. I talked to the manufacturer of my DSP, and they provided elaborate graphs that helped select the value for Rs, although the engineer did say that I could easily get by without it.
 
I get the impression that a lot of these circuit components are not absolutely necessary for a basic, minimally functional board. However, adding them can reduce noise if the right values are chosen. I talked to the manufacturer of my DSP, and they provided elaborate graphs that helped select the value for Rs, although the engineer did say that I could easily get by without it.

I read that Rs is supposed to be equal to Xc2, if x'tal freq is 11.2896MHz, and c2=32pf, then Rs = ~440 ohms.

I'm not sure if Rs would reduce noise or make the output into a sine wave. But it seems that it is needed to redcue the drive voltage to the x'tal, to prevent premature damage.

BTW, I looked at the waveform of my Si530 XO, it is already a sine wave.
 
Simpler than that and a whole lot 'cheesier', monostables as frequency discriminators. First one timed so that 44.1 keeps toggling but 48 does not. Second cascaded monostable either gets triggers from the first at 44.1 but no triggers at 48. Second mono give logic hi or lo for 48 or 44.1.

I SAID it was cheesy but it works reliably with no clocks and with 4000 series CMOS will not have power supply spikes or other 'nasties' because they can't go fast enough to matter.

 
Running 74HC or even 74AC between 1 and 2 volts could build a viable detector with push pull output and very low current switching pulse load. The output logic (which rarely switches) could be supplied at 3.3 volts and still accept something less than 2 volts for a logic high input. But, is the problem solvable of needing both clocks input once in a while?
 
I looked at the waveform of my Si530 XO, it is already a sine wave.
That's good. My DSP crystal circuit may actually be different that what's in the Transporter, but I got the impression that Rs was acting as part of an RC filter, thus the smoothing. But if you're already getting a sine wave (and it's not just the bandwidth limitations of your 'scope making it look at way), then you probably needn't worry.

Note: I ended up calculating an Rs of 100 Ω or less for my DSP, but, again, that's for a different oscillator driver.
 
I just found this EMI filter on Mouser:

KNH21C105DA3T AVX EMI Filter Beads, Chokes & Arrays

The P/N is KNH21C105DA3T.

If you look at the last page of the data sheet, the attenuation freq centers around 17MHz. And at 25MHz, I have about 70db attenuation.

Maybe I can use this filter for my 24.576MHz XO and kill the noise on the Vcc line?
That looks very interesting. The part appears to have four terminals. Two are clearly marked as in/out. Are the others supposed to be connected to ground? Are the vias depicted in the land patterns required?

To be honest, I can't tell whether this is supposed to be a capacitor for shunt EMI filtering or an inductive bead/choke for series EMI filtering.

When I suggested a small resistor, my intention was to create an impedance between the power source and the Vcc pin on the oscillator (driver). If you use an inductor (bead/choke) instead of a resistor, then I would expect a large voltage spike every time the current draw changes, because that's what inductors do. I will admit, though, that we're completely outside my experience when it comes to this part. I think I have something similar in stock, but I haven't used them yet.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.