# SNR computation in SRC (cntd..)

Started by October 1, 2005
```Hi r b-j,

I am trying to compute SNR with the method you've suggested. This time I
am trying upconversion of a signal from 8KHz to 44.1KHz. I have
implemented a four stage SRC code in matlab (with ratios 3/2, 3/2, 7/5
and
7/4 with filter taps 414, 54, 84 and 70 respectively using remez
algorithm). I multiply the output by a factor of 441 (3*3*7*7) in time
domain to compensate for interpolation stage losses. The frequency
response seems to be good. But still I am getting SNR not more than 30-40
DB. I am sure that I am not making a mistake in taking the delay into
account.

Ray had suggested to check 'Single precision float round-off error'. But
I
am using simple matlab floating point variables, which are by default
double-precision. (Ray, please correct me if I am failing to understand

Thank you

Govind

>in article urKdnY7SWfelqaneRVn-gw@giganews.com, Govind at
>govind_s@conceptemsys.com wrote on 09/23/2005 12:58:
>
>> I have written a simple matlab code for converting sampling rate from
8KHz
>> to 16KHz. Now I have to measure it's SNR. For this I converted both
the
>> signals to frequency domain (taking their FFTs) and then computed
>> signal-to-noise ratio (sum of squared input spectral samples devided
by
>> sum of squared difference between the output spectral samples and the
>> input spectral samples). With this method I am getting SNR not more
than
>> 50-60dB (even for very high filter lengths). Can you please tell me
what's
>> wrong with my method
>
>not a particular good method to compute SNR. try upsampling a collection
of
>known sine waves from 8 to 16kHz. then generate the exact same sine
waves
>(from the same math) but at the 16 kHz rate. make sure you have your
timing
>lined up because your SRC will have some delay. then subtract to get a
>difference (or error or "noise) signal and use that in your SNR
computation.
>
>> (I have seen posting mentioning that SNR should go as high as 140dB)?
>
>how long is your impulse response of your LPF? to get 140, you will
need
>
>
>--
>
>r b-j rbj@audioimagination.com
>
>"Imagination is more important than knowledge."
>
>
>

This message was sent using the Comp.DSP web interface on
www.DSPRelated.com
```
```Govind <govind_s@conceptemsys.com> wrote:

> I am trying to compute SNR with the method you've
> suggested. This time I am trying upconversion of a signal from
> 8KHz to 44.1KHz. I have implemented a four stage SRC code in
> matlab (with ratios 3/2, 3/2, 7/5 and 7/4 with filter taps 414,
> 54, 84 and 70 respectively using remez algorithm). I multiply the
> output by a factor of 441 (3*3*7*7) in time domain to compensate
> for interpolation stage losses. The frequency response seems
> to be good. But still I am getting SNR not more than 30-40 DB.

You could consider using Lagrangian interpolation instead of

Steve
```
```>Govind <govind_s@conceptemsys.com> wrote:
>
>> I am trying to compute SNR with the method you've
>> suggested. This time I am trying upconversion of a signal from
>> 8KHz to 44.1KHz. I have implemented a four stage SRC code in
>> matlab (with ratios 3/2, 3/2, 7/5 and 7/4 with filter taps 414,
>> 54, 84 and 70 respectively using remez algorithm). I multiply the
>> output by a factor of 441 (3*3*7*7) in time domain to compensate
>> for interpolation stage losses. The frequency response seems
>> to be good. But still I am getting SNR not more than 30-40 DB.
>
>You could consider using Lagrangian interpolation instead of
>
>Steve
>

Hi Steve,

Thanks for the reply. I have started looking for interpolation methods.
Would you like to suggest/give me related docs or book?

Govind

This message was sent using the Comp.DSP web interface on
www.DSPRelated.com
```
```The documentation on the analog devices sample rate conversion chips has some
good theory info.  Start here and also check out the datasheets for the parts
mentioned:

http://www.analog.com/en/content/0,2886,765%255F807%255F9690,00.html

By the way, if it were me, I would do this in one stage rather than 4.  It is
much simpler to implement that way (though probably requires more memory, but
that's not generally an issue in Matlab).

--
Jon Harris
SPAM blocker in place:
Remove 99 (but leave 7) to reply

"Govind" <govind_s@conceptemsys.com> wrote in message
news:WoqdnUGsSq4auN_eRVn-gQ@giganews.com...
> >Govind <govind_s@conceptemsys.com> wrote:
>>
>>> I am trying to compute SNR with the method you've
>>> suggested. This time I am trying upconversion of a signal from
>>> 8KHz to 44.1KHz. I have implemented a four stage SRC code in
>>> matlab (with ratios 3/2, 3/2, 7/5 and 7/4 with filter taps 414,
>>> 54, 84 and 70 respectively using remez algorithm). I multiply the
>>> output by a factor of 441 (3*3*7*7) in time domain to compensate
>>> for interpolation stage losses. The frequency response seems
>>> to be good. But still I am getting SNR not more than 30-40 DB.
>>
>>You could consider using Lagrangian interpolation instead of
>>
>>Steve
>>
>
> Hi Steve,
>
> Thanks for the reply. I have started looking for interpolation methods.
> Would you like to suggest/give me related docs or book?
>
> Govind
>
> This message was sent using the Comp.DSP web interface on
> www.DSPRelated.com

```