Author Topic: Help with DIY Spectrum analyzer IF filter  (Read 1864 times)

0 Members and 1 Guest are viewing this topic.

Offline WarspTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Help with DIY Spectrum analyzer IF filter
« on: November 28, 2024, 06:22:30 am »
Hi all,
I have been trying to design an audio range swept spectrum analyzer and am running into issues with my 32.768kHz crystal filter going in and out of self oscillation. I have based it off the design of a HP SA filter linked below and added my own modifications. So far I have tried reducing the Q by adding R20 and reducing the gain of each stage by reducing R1, but I am not sure if something else is at play. If anyone has any idea what could be going wrong, please let me know.
-Warsp

https://xdevs.com/doc/HP_Agilent_Keysight/3580A.pdf (p.162)
 

Online coppercone2

  • Super Contributor
  • ***
  • Posts: 11243
  • Country: us
  • $
Re: Help with DIY Spectrum analyzer IF filter
« Reply #1 on: November 28, 2024, 06:27:34 am »
I have no idea but the first thing that comes to mind is decoupling, I don't see any. I don't think just because its a transistor means that decoupling could hurt. I would try 100nF
 

Offline WarspTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Re: Help with DIY Spectrum analyzer IF filter
« Reply #2 on: November 28, 2024, 06:39:41 am »
I have placed a few decoupling 0.1uF capacitors on the power rails and assembled the filter on a copper clad board in order to attempt to rule out noise related issues. There could be other noise sources, but I do not think this is a noise related issue.
 

Offline ftg

  • Regular Contributor
  • *
  • Posts: 186
  • Country: fi
    • ftg's RF hax paeg
Re: Help with DIY Spectrum analyzer IF filter
« Reply #3 on: November 28, 2024, 08:02:52 am »
100nF has a rather high reactance at 32kHz, you may want to add some larger tantalums and electrolytics to the power rails.
As the feedback path for the oscillation could be through the supply rail.
 

Online coppercone2

  • Super Contributor
  • ***
  • Posts: 11243
  • Country: us
  • $
Re: Help with DIY Spectrum analyzer IF filter
« Reply #4 on: November 28, 2024, 08:43:42 am »
have you tried also just one circuit, instead of three?

I always found this circuit type interesting and I have been meaning to try to build a crystal filter for a long time (for low frequencies)

also, 12.5pF is small, I have no idea if its related but when you are almost in the single digit pico farad, prototyping can get hard (in general)

alot of that circuit seems like it has really insensitive values but 12.5pF is touchy.. sometimes with filters its possible to rescale components to get rid of really small values

Is it possible to rescale that stuff to turn that 12.5pF into like 50pF ?
« Last Edit: November 28, 2024, 08:52:46 am by coppercone2 »
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 15064
  • Country: de
Re: Help with DIY Spectrum analyzer IF filter
« Reply #5 on: November 28, 2024, 08:53:18 am »
The amplifier part has relatively poor power supply rejection. This make coupling via the supply likely. The type of amplifier is relative to GND at the input and relative to the supply at the output. I would consider a different amplifier type or maybe feedback from the output to input (gate side).

At the supply one could consider a separate RC filter for the supply for every stage (e.g. some 10 ohm + 100 nF + 10 or 100 µF).

p.s.: Another possible coupling is via the inductors.
 
The following users thanked this post: Warsp

Offline WarspTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Re: Help with DIY Spectrum analyzer IF filter
« Reply #6 on: November 28, 2024, 09:16:39 am »
100nF has a rather high reactance at 32kHz, you may want to add some larger tantalums and electrolytics to the power rails.
As the feedback path for the oscillation could be through the supply rail.


I added a couple large electrolytic capacitors to the power rails but the oscillation is still present.
 

Offline WarspTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Re: Help with DIY Spectrum analyzer IF filter
« Reply #7 on: November 28, 2024, 09:24:46 am »
have you tried also just one circuit, instead of three?

The first stage works relatively well on its own, but every stage added increases the intensity of the oscillations.

12.5pF is small, I have no idea if its related but when you are almost in the single digit pico farad, prototyping can get hard (in general)

alot of that circuit seems like it has really insensitive values but 12.5pF is touchy.. sometimes with filters its possible to rescale components to get rid of really small values

Is it possible to rescale that stuff to turn that 12.5pF into like 50pF ?

The 12.5pF capacitor is actually a 5.1pF capacitor in parallel with a trimmer. The purpose of this is to neutralize the shunt capacitance present in the crystal. Page 50 of the HP manual I linked above goes into much more detail on how this works if you are interested.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 21113
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Help with DIY Spectrum analyzer IF filter
« Reply #8 on: November 28, 2024, 09:38:26 am »
A photo of your construction might yield useful information.

If adding more gain stages increases the problem, that suggests coupling from later stages to the earlier stages.

If you reverse the order of the gain stages, does that change the behaviour?

Try inserting your finger into/onto the circuit, to see if that alters the behaviour.

The coupling might be via the PSU lines.
  • ensure the PSU wires run from the supply to the last gain stage then to the first gain stage. The large swings in later stages won't "go past" the first stage
  • decouple each gain stage separately, with a separate (small) resistor and capacitor

Emitter and source followers can oscillate at surprisingly high frequencies. That is easily seen on solderless breadboards with long wires, but is less likely on PCB/manhattan constructions with short wires.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline WarspTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Re: Help with DIY Spectrum analyzer IF filter
« Reply #9 on: November 29, 2024, 07:18:45 am »
I have followed tggzzz's and kleinstein's suggestions and completely revamped the power distribution in the filter, but the oscillations are still present. I have noticed however that increasing the gain of stage 2 by connecting a 0.1uF capacitor across R5 causes the filter to go into full self oscillation, while doing this on the other stages does not cause this. Another interesting thing that I noticed is that I can amplify the desired portion of the filter output by shorting C4, but this also causes the filter Q to decrease.

As per suggestion, I have included a photo of the filter construction in addition to an updated schematic.
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 15064
  • Country: de
Re: Help with DIY Spectrum analyzer IF filter
« Reply #10 on: November 29, 2024, 11:47:24 am »
shortening C4 essentially removes the crystal and just has the transformer as the main signal path.

The input amplifier as shown also has poor power supply rejection. One should have a filtered supply at least for R4.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 21113
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Help with DIY Spectrum analyzer IF filter
« Reply #11 on: November 29, 2024, 12:46:30 pm »
In addition, I'd try:
  • lowering the PSU filters' corner frequency from the current 6kHz. Every order of magnitude helps :)
  • shorting Q5's base to ground to check that kills the oscillation. Repeat with (all the) Q1's base. Shorting could be with a wire or with a suitably large capacitor.
  • waving hand+fingers around the circuit to try to increase capacitive coupling from output to input. You're looking to find anything that increases the probability/amplitude of oscillation, since that can indicate where the feedback is occurring
« Last Edit: November 29, 2024, 12:50:03 pm by tggzzz »
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: Warsp

Offline moffy

  • Super Contributor
  • ***
  • Posts: 2179
  • Country: au
Re: Help with DIY Spectrum analyzer IF filter
« Reply #12 on: November 29, 2024, 09:30:49 pm »
In dealing with high impedances and stray coupling you might want to try a small shielded box over the crystal filter section, decoupling the stray capacitances from the gain stages. It can be built out of small bits of PCB material.
 

Offline shabaz

  • Frequent Contributor
  • **
  • Posts: 552
Re: Help with DIY Spectrum analyzer IF filter
« Reply #13 on: November 29, 2024, 11:33:00 pm »
I've never built a crystal filter, so I'm speculating, and could be completely wrong:
At least from a birds-eye view, to me it looks like it might be very difficult to build and adjust. This circuit is even more complicated than just a single filter. After binning and finding the appropriate crystals, you've got quite a lot of adjustments to still do in the circuit (each stage appears to have at least three adjustments).

Maybe it would be easier to settle on just a single bandwidth, and build a simpler filter (still difficult to do, but relatively simpler!) constructed of a chain of passive networks of crystals, with any amplification and matching going on at the overall input and output of that chain of crystals. Your bandwidth would be controlled through careful positioning of the humps (i.e. you'd need a hundred or so crystals maybe, and check them all to find the few you'd use, i.e. a test fixture would be needed for that).

Some complexity would be reduced, but so would the ability to change the bandwidth (unless it was say a pluggable module).
« Last Edit: November 29, 2024, 11:34:50 pm by shabaz »
 
The following users thanked this post: Warsp

Offline RFDx

  • Regular Contributor
  • *
  • Posts: 181
  • Country: de
Re: Help with DIY Spectrum analyzer IF filter
« Reply #14 on: November 30, 2024, 05:29:22 am »
...running into issues with my 32.768kHz crystal filter going in and out of self oscillation.

Real oscillations or rather filter ringing due to the (very) narrow filter bandwidth and inappropriate high sweep rate? Did you do a standalone test with a slow manual sweep just on the passive filter stage(s)?

The crystals used in the IF unit of the HP 3580 AF spectrum analyzer are certainly not comparable with the miniature clock crystals you employ. Making an almost exact copy of the IF circuit from the service manual will not give you the results you are expecting.

The critical compensation capacitors (12.5pF) are imo too large and completely distort the amplitude response of the filter. The crystal static capacitance is quite small. An example is attached.

Owing to the very high crystal series resistance, switching between different filter load resistances will only have a negligible effect on the actual filter bandwidth but a major effect on filter loss.
 
The following users thanked this post: Warsp

Offline WarspTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Re: Help with DIY Spectrum analyzer IF filter
« Reply #15 on: November 30, 2024, 09:26:44 am »
I decided to switch the filter to a separate power source from the rest of the circuits in order to eliminate the possibility of another circuit causing issues. I also measured the noise on the power rail, and found that at most the noise ranged from +/-10mV. Most of the noise appears to be coming from other sources, so the efforts of trying to filter the power supply seem to have been somewhat successful.

I was able to reduce a portion of the oscillations by adding a 1k resistor to ground after C16, effectively creating a high pass filter at the input. I also noticed that stage 2 seems to be causing issues since bypassing it with a wire causes the filter to work for the most part. When stage 2 is removed, stage 1 also stops oscillating, so their is still feedback somewhere. I can't see any change in the noise on the power rail when stage 2 is not present, but there is only so much that can be seen with an analog oscilloscope. I will continue to look into the possible issues with stage 2.

Another thing I noticed is that a ~3kHz oscillation can be seen sometimes in parts of the filter and in the output. Could one of the components, such as the inductor or the transformer, be oscillating and causing some sort of cascade failure? I think this could also be a harmonic of something, but its frequency seems a little to low.

 

Offline WarspTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Re: Help with DIY Spectrum analyzer IF filter
« Reply #16 on: November 30, 2024, 09:27:42 am »
Did you do a standalone test with a slow manual sweep just on the passive filter stage(s)?

I set a very slow sweep rate of around 1Hz and the oscillations were still present.

The critical compensation capacitors (12.5pF) are imo too large and completely distort the amplitude response of the filter. The crystal static capacitance is quite small. An example is attached.

Owing to the very high crystal series resistance, switching between different filter load resistances will only have a negligible effect on the actual filter bandwidth but a major effect on filter loss.

The reason I kept the compensation values rather large and added load resistors was that lowering the compensation capacitance caused a large decrease in gain in the desired portion of the waveform to the point where the filter became useless, and the load resistors were necessary to keep the filter from going into full self oscillation.

I have however followed your suggestions since I figured out how to fix some of these issues.
 

Offline WarspTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Re: Help with DIY Spectrum analyzer IF filter
« Reply #17 on: November 30, 2024, 09:33:19 am »
On a side note, choosing this complicated filter topology was probably not one of my brightest ideas, especially since I am still a novice at electronics and lack any sort of degree. Like Shabaz suggested, something like a crystal ladder filter should have been used, and would have greatly reduced the complexity and time used. It does seem like there is hope for the current filter to work, so this isn't a complete waste.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 21113
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Help with DIY Spectrum analyzer IF filter
« Reply #18 on: November 30, 2024, 10:04:03 am »
We all remember pushing our knowledge and understanding, creating things that sort-of worked. It is fun, and the good thing is that electronics is a wide field so it will always be possible to do that :)

If you want a bandpass filter, how about making one with a Q of, say 15000 and sharp skirts of 140000dB/decade - and a sweepable centre frequency? With 10% resistors and capacitors and one simple generic IC :) I needed to do that back in the late 70s, to reduce noise. The dynamic range was limited, but a quick experiment with modern components leads me to believe it is not such a problem now.

Here's a plot using modern components: https://www.eevblog.com/forum/testgear/ad3-or-budget-bench-setup/msg5546397/#msg5546397
« Last Edit: November 30, 2024, 10:09:52 am by tggzzz »
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Manul

  • Super Contributor
  • ***
  • Posts: 1256
  • Country: lt
Re: Help with DIY Spectrum analyzer IF filter
« Reply #19 on: November 30, 2024, 10:53:16 pm »
My two cents suggestion would be to turn inductors by 90 degrees in adjacent stages (minimize coupling) or even better - use toroidal core or other "shielded" inductors.

P.S. it should be easy to test if unwanted coupling is indeed magnetic between inductors/transformers. Find a small ferrite stick and try to make it worse by introducing more coupling.
 
The following users thanked this post: Warsp

Online coppercone2

  • Super Contributor
  • ***
  • Posts: 11243
  • Country: us
  • $
Re: Help with DIY Spectrum analyzer IF filter
« Reply #20 on: November 30, 2024, 10:56:46 pm »
what type of crystal is recommended for this circuit?

I also thought, get rid of the zig zag.... and since its only passing a signal between stages... what if you made a seperate PCB for each stage? And used a twisted pair to carry the signal
 
The following users thanked this post: Warsp

Offline WarspTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Re: Help with DIY Spectrum analyzer IF filter
« Reply #21 on: December 01, 2024, 10:58:43 am »
My two cents suggestion would be to turn inductors by 90 degrees in adjacent stages (minimize coupling) or even better - use toroidal core or other "shielded" inductors.

I turned the inductors and now the coupling is much lower, so magnetic coupling was obviously a big issue. I have now turned the inductors right side up in order to have the strongest magnetic fields pointing away from the other parts of the filter.

what type of crystal is recommended for this circuit?

I couldn't really find anything on the internet about a suggested crystal type, but I do not think tuning fork crystals are the ideal crystal type to use.

I also thought, get rid of the zig zag.... and since its only passing a signal between stages... what if you made a seperate PCB for each stage? And used a twisted pair to carry the signal

Good point. I plan on moving at least stage 2 since the stages being so close together isn't helping matters.

I also realized that their is still some coupling through the power supply, particularly through the first emitter follower which I forgot to filter. Fixing that will hopefully reduce the coupling even more.
 

Offline WarspTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Re: Help with DIY Spectrum analyzer IF filter
« Reply #22 on: December 01, 2024, 11:03:28 am »
We all remember pushing our knowledge and understanding, creating things that sort-of worked. It is fun, and the good thing is that electronics is a wide field so it will always be possible to do that :)

If you want a bandpass filter, how about making one with a Q of, say 15000 and sharp skirts of 140000dB/decade - and a sweepable centre frequency? With 10% resistors and capacitors and one simple generic IC :) I needed to do that back in the late 70s, to reduce noise. The dynamic range was limited, but a quick experiment with modern components leads me to believe it is not such a problem now.

Here's a plot using modern components: https://www.eevblog.com/forum/testgear/ad3-or-budget-bench-setup/msg5546397/#msg5546397

This whole project could have been replaced with a single device running a fft, but that wouldn't have been as fun :). It is amazing what modern hardware can do.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 21113
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Help with DIY Spectrum analyzer IF filter
« Reply #23 on: December 01, 2024, 05:58:00 pm »
We all remember pushing our knowledge and understanding, creating things that sort-of worked. It is fun, and the good thing is that electronics is a wide field so it will always be possible to do that :)

If you want a bandpass filter, how about making one with a Q of, say 15000 and sharp skirts of 140000dB/decade - and a sweepable centre frequency? With 10% resistors and capacitors and one simple generic IC :) I needed to do that back in the late 70s, to reduce noise. The dynamic range was limited, but a quick experiment with modern components leads me to believe it is not such a problem now.

Here's a plot using modern components: https://www.eevblog.com/forum/testgear/ad3-or-budget-bench-setup/msg5546397/#msg5546397

This whole project could have been replaced with a single device running a fft, but that wouldn't have been as fun :). It is amazing what modern hardware can do.

N-path filters are amazing in a different way. The only semiconductor I used in the 70s was a 4066 analogue switch.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline LaserSteve

  • Super Contributor
  • ***
  • Posts: 1354
  • Country: us
Re: Help with DIY Spectrum analyzer IF filter
« Reply #24 on: December 02, 2024, 04:58:14 pm »
I have a few leftover large cased crystals around 39 Khz that planar, thus  are not forks. I can drop you one in the mail if you wish. Might make tuning easier.  Forks have wonderful properties , but they have some bad modes too.

Drop me a PM.

Steve
"When in doubt, check the Byte order of the Communications Protocol, By Hand, On an Oscilloscope"

Quote from a co-inventor of the PLC, whom i had the honor of working with recently.
 
The following users thanked this post: pardo-bsso, Warsp


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf