2010-05-20 22:08:03     Does the linux soc audio driver have a LPF in it?

Document created by Aaronwu Employee on Aug 21, 2013
Version 1Show Document
  • View in full screen mode

2010-05-20 22:08:03     Does the linux soc audio driver have a LPF in it?

Zhi Qiang Zhang (CHINA)

Message: 89606   

 

Hi,

 

I am using BF512, and make a program to play sine wave audio in different frequency, and check the frequency response. I set the 1K sine wave output to 0dB for frequency response reference. The frequency response is -0.2dB in 15K sine wave, but the 16K sine wave is -1.2dB, and -5dB in 20K sine wave.

 

I have disable the de-emphasis filter of the codec, and I changed another model of codec, the result is the same, so I wonder if there is a LPF filter in the linux audio driver?

 

 

 

Regards,

 

ZhangZQ

QuoteReplyEditDelete

 

 

2010-05-20 23:18:54     Re: Does the linux soc audio driver have a LPF in it?

Mike Frysinger (UNITED STATES)

Message: 89608   

 

you need to describe the actual hardware/software things you're using.  what audio codec ?  how exactly are writing/reading audio ?

QuoteReplyEditDelete

 

 

2010-05-20 23:58:06     Re: Does the linux soc audio driver have a LPF in it?

Zhi Qiang Zhang (CHINA)

Message: 89610   

 

Mike,

 

I am using this version of the uclinux for BF512,

 

 

 

Linux version 2.6.33.3-ADI-2010R1-pre-svn8687 (zzq01@localhost.localdomain) (gcc version 4.1.2 (ADI svn)) #26 PREEMPT Wed May 5 14:56:35 CST 2010

 

 

 

There is a PCM1742 codec connects to the SPORT0 of the BF512 using the Left-Justified format. BF512 generates the TFS, TSCLK, DTPRI signal. There is a 22.5792Mhz crystal used for the clock signal fo BF512, and the system clock for the codec.

 

 

 

I have a standard audio CD that the audio tracks are for different frequency sine wave. I made a program to read that audio cd for specified track and send the audio data to /dev/dsp device.

 

 

 

It is no problem to play that audio cd for 1KHz, 2KHz, 8Khz, 10Khz, 15Khz, but the attenuation appears when playing the 16Khz sine wave, the attenuation is -1.2dB(set the 1Khz sine wave to 0dB for reference), and it is -5.2dB when playing 20KHz, the acceptable range is less than -2dB in 20KHz signal.

 

 

 

I changed the AK4388 codec to test, result is the same.

 

 

 

Regards,

 

ZhangZQ

QuoteReplyEditDelete

 

 

2010-05-21 00:22:57     Re: Does the linux soc audio driver have a LPF in it?

Sonic Zhang (CHINA)

Message: 89611   

 

Could you try to run tone with 1KHz, 2KHz, 8Khz, 10Khz, 15Khz and 16Khz? What's the result?

QuoteReplyEditDelete

 

 

2010-05-21 01:19:11     Re: Does the linux soc audio driver have a LPF in it?

Zhi Qiang Zhang (CHINA)

Message: 89612   

 

Sonic,

 

 

 

I've tried tone before, but the tone can't generate sine wave higher than 15KHz, for 1K-15Khz, the result is the same as playing that CD.

 

 

 

And it must not be the problem of codec, I've used this codec in others products, did not find this problem.

 

 

 

Regards,

 

ZhangZQ

QuoteReplyEditDelete

 

 

2010-05-21 05:07:01     Re: Does the linux soc audio driver have a LPF in it?

Wolfgang Muees (GERMANY)

Message: 89632   

 

ZhangZQ,

 

I do not think that the linux audio driver has a digital low pass filter.

 

Is your codec using the sharp roll-off or the slow roll-off?

 

Have you measured the sampling frequency of your codec?

TranslateQuoteReplyEditDelete

 

 

2010-05-21 06:09:05     Re: Does the linux soc audio driver have a LPF in it?

Zhi Qiang Zhang (CHINA)

Message: 89634   

 

Wolfgang,

 

 

 

This codec is using sharp roll-off in default. And I used this codec in another products with its default mode before, did not find this problem, this only difference is, the system clock of the codec is 16.9344Mhz, but now it is 22.5792MHz, is that the problem?

 

 

 

The default sampling frequency of this codec is 44100Hz.

 

 

 

Regards,

 

ZhangZQ

QuoteReplyEditDelete

 

 

2010-05-21 10:08:05     Re: Does the linux soc audio driver have a LPF in it?

Wolfgang Muees (GERMANY)

Message: 89639   

 

ZhangZQ,

 

it should be very simple for you to modify the kernel driver which is emitting the data to the codec to emit a synthetic sine wave of 44100/3 = 14700 Hz. You only need 6 constant-value samples giving 2 full sine waves, and doing an endless repeat. And then you can measure the codec output and you can compare with a sine wave of 14700 Hz you play from userland.

 

regards

 

Wolfgang

TranslateQuoteReplyEditDelete

 

 

2010-05-21 12:02:53     Re: Does the linux soc audio driver have a LPF in it?

Zhi Qiang Zhang (CHINA)

Message: 89641   

 

Wolfgang,

 

 

 

There is an existing program 'tone' in uclinux/user/play that generates the sine wave in specified frequency, the maxinum frequency 'tone' can generate is the 14700Hz sine wave, but the output is very good, as I mentioned,

 

 

 

'It is no problem to play that audio cd for 1KHz, 2KHz, 8Khz, 10Khz, 15Khz, but the attenuation appears when playing the 16Khz sine wave, the attenuation is -1.2dB(set the 1Khz sine wave to 0dB for reference), and it is -5.2dB when playing 20KHz, the acceptable range is less than -2dB in 20KHz signal.'

 

 

 

The sine wave higher than 14700Hz is represented by harmonic wave.

 

 

 

 

 

Regards,

 

ZhangZQ

QuoteReplyEditDelete

 

 

2010-05-25 01:33:41     Re: Does the linux soc audio driver have a LPF in it?

Wolfgang Muees (GERMANY)

Message: 89817   

 

ZhangZQ,

 

yes, 14700 Hz will have no problem. But you can apply the method for higher frequencies: Using a sample rate of 44100 Hz, 5 samples making 2 sine periods will give you a frequency of 44100/2.5 = 17640 Hz.

 

regards

 

Wolfgang

Attachments

    Outcomes