Wie frequenzstabil ist ein Oszillator mit CMOS Schmitt-Trigger?

Jun 08, 2026 Last reply: 1 month ago 36 Replies

  1. Gott erhalte Franz, den Kaiser, Unsern guten Kaiser Franz! Lange lebe Franz, der Kaiser, In des Glückes hellstem Glanz! Ihm erblühen Lorbeerreiser, Wo er geht, zum Ehrenkranz! Gott erhalte Franz, den Kaiser, Unsern guten Kaiser Franz!

/ralph -- wobei mich das Ding mit dem gelben Fluss mehr interessieren würde

Soll das wie eine Glocke klingen? Dann brauchst Du eine andere Wellenform und musst auch etwas an der Hüllkurve machen. Eine Rechteckschwingung (ich nehme an, das ist die Wellenform, die so ein S-T erzeugt) klingt wie ein Holzblasinstrument.

Martin

Nein, Türglocke ist nur eine andere Bezeichnung von Türklingel. Eine Glocke elektronisch nachzubilden, erfordert AFAIK einen höheren Aufwand.

Kai-Martin Knaak snipped-for-privacy@invalid.invalid schrieb oder zitierte:

Glockenartige Klänge lassen sich mit einem Ringmodulator hervorragend erzeugen, da das menschliche Gehör die dabei entstehenden, unharmonischen Frequenzanteile (Inharmonizität) automatisch mit Metall oder Glocken assoziiert.

Für den perfekten Glockensound multipliziert der Ringmodulator zwei Signale - den Carrier (Träger) und den Modulator - wodurch die mathematischen Summen- und Differenzfrequenzen fc+fm und fc-fm entstehen, während die Grundfrequenzen ausgelöscht werden.

Python

import io import math import wave

def buffer_to_wav(buffer, filename, channels=1, sample_width=2, frame_rate=44100): """Writes an in-memory byte buffer directly into a standard WAV file.""" with wave.open(filename, 'wb') as wav_file: wav_file.setnchannels(channels) wav_file.setsampwidth(sample_width) wav_file.setframerate(frame_rate) wav_file.writeframes(buffer)

def generate_bell_demo(): # Audio formatting configuration frames_per_second = 44100 duration_seconds = 3.5 total_frames = int(frames_per_second * duration_seconds) # Ring modulation setup: an inharmonic, slightly detuned frequency pair f_carrier = 440.0 # Fundamental base frequency (A4) f_modulator = 622.25 # Unrelated tritone multiplier (D#5) for that metallic clang # Envelope (hull curve) properties attack_frames = int(frames_per_second * 0.005) # 5ms instant transient impact decay_factor = 2.5 # Controls how fast the bell fades stream = io.BytesIO()

for i in range(total_frames): t = i / frames_per_second # 1. Ring Modulation Engine (Carrier * Modulator) carrier_wave = math.sin(2 * math.pi * f_carrier * t) modulator_wave = math.sin(2 * math.pi * f_modulator * t) rm_signal = carrier_wave * modulator_wave # 2. Bell Envelope (Hull Curve) if i < attack_frames: # Linear ramp up for the strike envelope = i / attack_frames else: # Exponential decay curve mimicking a physical strike decay_time = (i - attack_frames) / frames_per_second envelope = math.exp(-decay_factor * decay_time) # Combine the signal and envelope, then scale to 16-bit boundaries (-32768 to 32767) final_signal = rm_signal * envelope int_sample = int(final_signal * 32767) int_sample = max(-32768, min(32767, int_sample)) # Pack the integer directly to little-endian 2-byte format stream.write(int_sample.to_bytes(2, byteorder='little', signed=True))

# 3. Save the stream buffer_to_wav( stream.getbuffer(), 'output_bell_20260609134343_TMP.wav', channels=1, sample_width=2, frame_rate=frames_per_second )

if __name__ == '__main__': generate_bell_demo() print("Successfully generated 'output_bell.wav'!")

snipped-for-privacy@zedat.fu-berlin.de (Stefan Ram) schrieb oder zitierte:

Chatbot:

[ Trigger Input ] │ ▼ ┌───────────────┐ │ Envelope │─────────┐ │ Generator │ │ (Control Voltage) └───────────────┘ ▼ ┌───────────┐ ┌───────────────┐ │ Voltage │ │ Oscillator A │──>│Controlled │ │ (440Hz Sine) │ │ Amplifier │ └───────────────┘ │ (VCA) │ └───────────┘ │ ▼ (Damped Carrier) ┌───────────┐ │ Ring │ │ Modulator │──> [ Audio Output ] └───────────┘ ▲ │ (Constant Modulator) ┌───────────────┐ │ │ Oscillator B │─────────┘ │(622Hz Tri/Sine) └───────────────┘

| Component Breakdown & Design | | 1. The Oscillators (Carrier & Modulator) | | The Chips Use an AS3340 (or Alfa RPAR AS3340) or standard NE566 | Function Generators. | | The Waveforms Set Oscillator A to a Sine wave. Set Oscillator B to | either a Sine or a Triangle wave. | | Tuning Use a potentiometer to manually tune Oscillator A to 440 Hz | and Oscillator B to roughly 622 Hz. Because these circuits naturally | drift slightly with temperature, they will inherently provide that | organic, imperfect "metallic clang." | | 2. The Envelope Generator (The Damped Hull Curve) | | To mimic the exponential decay curve from the Python script: | | The Design A basic AR (Attack-Release) or AD (Attack-Decay) circuit | built around a standard NE555 timer or a dual operational amplifier | (like the TL072). | | The Controls | | Attack Fixed at a very low resistance (or a 1 kΩ resistor) to ground | to ensure a near-0 ms rise time when a trigger pulse hits. | | - Decay: A variable 500 kΩ potentiometer connected to a 1μF capacitor. | Adjusting this pot alters the RC time constant, matching the | decay_factor of your code to let the sound ring out for several | seconds. | | 3. The Dynamics & Modulation (VCA & Ring Mod) | | In classic analog synthesis, you have two options for structuring the | signal flow. Pre-shaping the carrier is usually cleaner: | | The VCA (Velocity/Volume Control) Route the sine output of | Oscillator A into an AS3180 or LM13700 Operational Transconductance | Amplifier (OTA) configured as a Voltage Controlled Amplifier. Feed the | Envelope Generator’s output into the VCA’s control input. The output | is a 440 Hz tone that strikes instantly and decays exponentially. | | The Ring Modulator (The Multiplier) Feed the output of the VCA into | "Input X" of an AD633 Analog Multiplier chip. Feed the raw, constant | output of Oscillator B into "Input Y". | | Why this works The AD633 mathematically multiplies the two real-time | voltages (X × Y). Because the Carrier input (X) is already decaying to | zero volts due to the VCA, the resulting ring-modulated output will | also seamlessly decay to zero, leaving absolute silence between | triggers. | | ---------------------------------------------------------------------- | | Complete Practical Schematic Guide | | If building this on a breadboard or designing a PCB, follow these IC | pin-out configurations: | | ----------------------------------------------------------------------- | Stage Main IC Function | ----------------------- ----------------------- ----------------------- | Trigger Input 1N4148 Diode Protects the circuit | from reverse-voltage | trigger spikes. | | Envelope TL072 (Op-Amp) Configured as a passive | RC integrator with a | buffering op-amp to | output a smooth 0V to | 8V curve. | | Gain / Shaping LM13700 (Dual OTA) Uses one half of the | chip to attenuate | Oscillator A based on | the TL072 envelope | voltage. | | Core Modulation AD633 (4-Quadrant Connect shaped Carrier | Multiplier) to Pin 1 (X1), | Oscillator B to Pin 3 | (Y1). Ground pins 2 and | 4. Output is taken from | Pin 7 (W) via a 10μF | AC-coupling capacitor | to remove DC offset. | -----------------------------------------------------------------------

snipped-for-privacy@zedat.fu-berlin.de (Stefan Ram) schrieb oder zitierte:

PS: Es wäre natürlicher, den VCA für die Hüllkurve hinter den Ringmodulator zu setzen. Man nehme daher das Vorposting nicht zu wörtlich, sondern nur als grobe Inspiration.

Wie eine Triola.

PWM. Glocke hat harten Anschlag und klingt dann langsam aus. Du beginnst einfach mit 1:1 und fährst das langsam runter. Siemens hatte das dann allerdings so gmacht, dass die Töne viel länger nachklingen. Also während den nächste Ton schon gestartet ist.

MfG hjs

snipped-for-privacy@zedat.fu-berlin.de (Stefan Ram) schrieb oder zitierte:

Hier ist eine Netlist-Datei, die man mit LTspice öffnen kann. Sie erzeugt eine wav-Datei. Ich glaube, es klingt jetzt noch metallischer als die Ausgabe der Python-Datei.

Meine Grundidee ist, daß man den Klang zunächst mit SPICE erproben kann, bevor man dann eine Schaltung aufbaut. Die Netlist von SPICE enthält noch keine konkreten Bauteile, aber man kann den verschiedenen Funktionen dann meist konkrete Bauteile zuordnen, zum Beispiel für PULSE einen Oszillator wie NE555 oder (teurer und besser) TL074.

[1] bell.cir

Bell Sound Generator

  • Save as bell.cir

  • --- PARAMETERS --- .param F_carrier1 = 440 $ Base pitch tone (Hz) .param F_mod1 = 523 $ Creates primary sidebands .param F_carrier2 = 783 $ High metallic chime overtone (Hz) .param F_mod2 = 1150 $ High-frequency disruptor (Hz)

  • --- WAVEFORM GENERATORS (Rich Harmonics) ---
  • V_c1: Triangle Wave (Using PULSE with equal rise/fall times) V_c1 V_c1 0 PULSE(-1 1 0 1.136m 1.136m 10u 2.272m)

  • V_m1: Square Wave (Using PULSE with 50% duty cycle) V_m1 V_m1 0 PULSE(-1 1 0 10u 10u 0.956m 1.912m)

  • V_c2 & V_m2: Secondary high-pitched clusters for the initial "clang" V_c2 V_c2 0 PULSE(-1 1 0 0.638m 0.638m 10u 1.277m) V_m2 V_m2 0 PULSE(-1 1 0 10u 10u 0.434m 0.869m)

  • --- DUAL-STAGE ENVELOPE GENERATORS ---

  • Env 1: Long decay for the fundamental hum (1.5 seconds) V_env_long V_env_l 0 EXP(0 1 0 0.001 0 1.5)

  • Env 2: Ultra-fast decay for the harsh metallic strike tone (0.15 seconds) V_env_short V_env_s 0 EXP(0 1 0 0.001 0 0.15)

  • --- RING MODULATORS (Multipliers) --- B_ring1 V_rm1 0 V=V(V_c1)*V(V_m1) B_ring2 V_rm2 0 V=V(V_c2)*V(V_m2)

  • --- VOLTAGE CONTROLLED AMPLIFIERS & MIXER ---

  • Multiply Ring 1 by the long sustain envelope B_vca1 V_part1 0 V=V(V_rm1)*V(V_env_l)

  • Multiply Ring 2 by the rapid strike envelope (mix amount scaled down to 0.6) B_vca2 V_part2 0 V=V(V_rm2)*V(V_env_s)*0.6

  • Combine both components into the final output B_mixer V_out 0 V=V(V_part1)+V(V_part2)

  • --- SIMULATION COMMANDS --- .tran 10u 3.0

  • --- EXPORT TO WAV AUDIO (LTspice Specific Directive) --- .wave "bell_metallic.wav" 16 44.1k V(V_out)

.end

Ist doch geil. 1 IC und etwas Hühnerfütter, Klang ok.

Es gibt wohl eine Schaltung wo zwei Stueck von dem Teil leicht verstimmt schwebend genutzt werden.

Aber ehrlich, ich wuerde den auch nicht nutzen. Es muss ja noch Fortschritt geben in der Welt.

Olaf

Es ginge auch noch Dr. Who Atomalarm als MP3. :-D

Aber wie ich schon sagte, diese Teilen haben einen schrecklich hohen Ruhestrom. Da muss man ran wenn der mit Batterien laufen soll.

Olaf

ELV. Habe ich vor Jahrzehnten einmal aufgebaut.

-- /¯\ No | Dipl.-Ing. F. Axel Berger Tel: +49/ 221/ 7771 8067 \ / HTML | Roald-Amundsen-Straße 2a Fax: +49/ 221/ 7771 8069  X in | D-50829 Köln-Ossendorf

formatting link
\ Mail | -- No unannounced, large, binary attachments, please! --

Mmmmh. Also drei Bit könnten sich schon ziemlich erbärmlich anhören. Willst Du da einen "Redneck-DAC" mit R-2R-Leiter dranhängen?

Dann mach doch gleich Sigma-Delta- bzw. Delta-Sigma-Modulation. Aber einen uC wie den ATtiny85 willst Du ja nicht. Obwohl man da durchaus was lernen könnte

*), die 512 Bytes RAM sind eine echte Herausforderung.

Volker

*)

- RLL / Lauflängencodierung (Run-Length Encoding)

- Looping von Perioden statt Samples

- Amplitude über Bitdichte (Duty / Pulse Density / ΣΔ-artig)

Pyrophon!

formatting link

Auch sehr schön!

Oh-oh! Vielleicht ein Monoflop mit MOSFET. Macht das Kraut dann auch nicht mehr fett. Aber irgendwie fände ich gerade die nebenan bemerkte Geschichte mit dem ATtiny85 recht attraktiv. Die geringen Ressourcen sind eine echte Herausforderung. Stromverbrauch wäre auch kein Ding.

Volker

Im EPROM würde ich nur die Sequenz der Töne ablegen, keine Sample einer Türglocke. Für normale Töne reichen 3 Bit aus.

Ich hätte einige PIC 16F627. Damit würde es noch herausfordernder.

Am 08.06.26 um 13:14 schrieb Peter Heitzer:

Die Metallfilmwiderstände kannst du dir schenken. Die Schaltschwellen sind temperaturabhängig. Und einmal abgleichen musst du eh.

Gegeneinander dürfte zu schaffen sein. Absolut eher nicht.

Marcel

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required