tftb-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tftb-help] RE: Tftb-help Digest, Vol 4, Issue 3


From: jocelyn lu
Subject: [Tftb-help] RE: Tftb-help Digest, Vol 4, Issue 3
Date: Wed, 07 Jun 2006 19:49:09 +0800


Hi, Eric,

Regarding your reply, I have one question:
energy is defined as : energy=average_power x time = mean[abs(sig).^2] x [length(sig)/fs],
but refer to the program, energy = mean[abs(sig).^2].
I'm wondering how do you consider the part of [length(sig)/fs] when implementing this sigmerge.m.From your reply, you seems assumed fs=1, then how about length(sig) portion? and if test on real-life signal which fs is not a unit sample, eg,fs=8khz. this program still can work on such real-life signal?


Thanks,
Jocelyn

From: Eric Chassande-Mottin <address@hidden>
To: jocelyn lu <address@hidden>
CC: address@hidden
Subject: RE: Tftb-help Digest, Vol 4, Issue 3
Date: Tue, 6 Jun 2006 10:28:29 +0200 (CEST)


> Hi, Eric,
>
> Thanks for your clear explaination.
>
> I found one doubt point in file "sigmerge.m".

> %SIGMERGE Add two signals with given energy ratio in dB.
> % SIG=SIGMERGE(X1,X2,RATIO) adds two signals so that a given
> % energy ratio expressed in deciBels is satisfied.
> %
> % X1, X2 : input signals.
> % RATIO  : Energy ratio in deciBels (default : 0 dB).
> % X      : output signal.
> % X= X1+H*X2, such that 10*log(Energy(X1)/Energy(H*X2))=RATIO
> %
> % Example :
> %  sig=fmlin(64,0.01,0.05,1); noise=hilbert(randn(64,1));
> %  SNR=15; x=sigmerge(sig,noise,SNR);
> %  Esig=mean(abs(sig).^2); Enoise=mean(abs(x-sig).^2);
> %  10*log10(Esig/Enoise)
>
> (1)
> let's say x=sig+H*noise as per implementation, my doubt point is at the last
> two lines,
> is it should be noise=(x-sig)/H, Enoise=mean{[abs(x-sig)/H].^2} and
> SNR=10*log10[Esig/(H^2)Enoise] ?

you've been confused by the name of the variable "Enoise". in the example
of the online help,

Enoise=mean(abs(x-sig).^2);

is not the energy of "noise" but the energy of "H*noise=x-sig", i.e., the
energy of the noise after scaling to the desired SNR. following this
definition, Enoise is therefore equal to H^2*Energy(noise) and this matches your
expression of the SNR.

> >From the programming, energy_of_H =H^2 ?

i don't understand this question. it is not appropriate to speak of the
energy of a scaling factor.

> (2)
> % Ex1=mean(abs(x1).^2);
> above should be a power calculation. But here make it as energy calculation,
> is it proper?

yes, Ex1 computes the energy contents per unit sample
and in this respect is closer to a power than an energy measurement.

eric.

_________________________________________________________________
Take a break! Find destinations on MSN Travel. http://www.msn.com.sg/travel/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]