Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 22:36 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : carrier filter

Author Message
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2127
Posted: 06:19pm 26 Mar 2024
Copy link to clipboard 
Print this post

any good as a 44KHz filter?

 :------100pF------:
--:                 :--out
 :--150---:---20K--:
          :
         47nF
          :
          :
-----------:-----------
























;
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4227
Posted: 07:48am 28 Mar 2024
Copy link to clipboard 
Print this post

Hi Stanley,

It is a nice filter, that definitely rejects 44kHz. But the rejection is not as good as the LC filter that we use now. See graph. The red (your filter) has a dip at 44kHz, but it is not as deep.



But what is more important. The output impedance of the filter is quite high. You need an opamp or buffer amplifier before you can connect a headset or audio system. This is an example with 1k ohm load. You see that the red curve in general is much lower (so less audio).



And with 32 ohm (ear pieces) is is even worse. Almost not audible. So you need an amplifier....

Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 10:25am 28 Mar 2024
Copy link to clipboard 
Print this post

I'm still wondering why the 44 KHz filter is necessary. This is the samplerate. The highest frequency that can be generated is half the samplerate, and imho the filter should be used at 22 KHz.

Just my two cents
Martin
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4227
Posted: 11:02am 28 Mar 2024
Copy link to clipboard 
Print this post

Martin,

Stanley is trying to find a cheaper solution for the filter.

About the 44kHz versus 22kHz. Yes, a filter that removes everything above 22kHz is the best solution. It will also remove 44kHz. These filters can be designed as digital filters, or as analog filters.

In our case a digital filter is not an option. When you filter the input signal, you have to output it again. And when you use PWM...you need to add a filter...again. When you use a DAC the filter is simpler, but then you would add a MCP4822 DAC, and forget about the filter completely.

An analog filter that passes 20kHz, but rejects 22kHz can be made. Actually, that was in the first CD players. It includes (per channel) 6 inductors, of which 4 are "tuned", meaning you have to adjust them. That has been only in 1 generation of CD players. It was much to expensive. After that they used different techniques, such as oversampling (change 44kHz to 176kHz). Then you need a filter that passes 20kHz, and has to reject 88kHz. Much simpler.

We cannot do that in the picomite. When running the PWM at 44kHz, we get 11 bit resolution and use up to 23% CPU power. Doubling the PWM frequency means only 10 bit resolution, and would consume more CPU power. Not necessary double, but more.

Another thing to consider is the amplitude. The PWM outputs 3.3V signal. This is the 44kHz signal. The PWM is modulated with the desired audio signal. The amplitude of the audio signal in the PWM is maximum 3.3V (volume max, tone output), but in practise it is only 1V or lower (play sound is 25% max). But this shows that attenuating the 44kHz is more important than attenuating everything above 22kHz. And that is what the current filter does. 20dB rejection an 22kHz, 60dB at 44kHz).

Volhout
Edited 2024-03-28 21:09 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024