Reply by August Reno December 9, 20052005-12-09
Thank you I figured it out!
August
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> az al&#4294967295;bbiakat &#4294967295;rta a 
k&#4294967295;vetkez&#4294967295; h&#4294967295;r&#4294967295;zenetben: QrmdnfzrdvW0mgTenZ2dnUVZ_tudnZ2d@centurytel.net...
> > "August Reno" <a_reno@tiscali.it> wrote in message > news:dna3i9$5d0$1@namru.matavnet.hu... >> Hello All! >> I obtained a matlab code which do the zero forcing equalization on >> an awgn channel, and plots the BER vs. SNR >> Please look at this small code if it is correct, my question is: >> where are the filter coefficients here or how can I obtain this, as I >> don't see them ??? >> Thanks for you effort, >> Reno >> >> >> N: number of symbols we transmit >> h: impulse response >> snrDB: SNR in dB, actually: >> snrdB_min = 1; snrdB_max = 10; >> snrdB = snrdB_min:1:snrdB_max; >> ----- >> >> function z = zf(N,h,snrdB) >> >> lg=length(h); >> y=sign(randn(1,N)); >> sk=filter(h,1,y); >> snr=10.^(snrdB/10); >> >> nu=normrnd(0,(1/sqrt(snr)),1,N); >> x=sk+nu; >> ykegalZF=filter(1,h,x); >> aklinZF=sign(ykegalZF(1:N)); >> PelinZF=sum(abs(y-aklinZF)/2); >> errorZF=PelinZF/N; >> >> %semilogy(RSBdB, PelinZF,'r*'); hold on; > > Just read the definition for "filter" and you'll see how the coefficients > are used. > The coefficients are "h" and are *inputs* to the function..... > > Fred >
Reply by Fred Marshall December 9, 20052005-12-09
"August Reno" <a_reno@tiscali.it> wrote in message 
news:dna3i9$5d0$1@namru.matavnet.hu...
> Hello All! > I obtained a matlab code which do the zero forcing equalization on > an awgn channel, and plots the BER vs. SNR > Please look at this small code if it is correct, my question is: > where are the filter coefficients here or how can I obtain this, as I > don't see them ??? > Thanks for you effort, > Reno > > > N: number of symbols we transmit > h: impulse response > snrDB: SNR in dB, actually: > snrdB_min = 1; snrdB_max = 10; > snrdB = snrdB_min:1:snrdB_max; > ----- > > function z = zf(N,h,snrdB) > > lg=length(h); > y=sign(randn(1,N)); > sk=filter(h,1,y); > snr=10.^(snrdB/10); > > nu=normrnd(0,(1/sqrt(snr)),1,N); > x=sk+nu; > ykegalZF=filter(1,h,x); > aklinZF=sign(ykegalZF(1:N)); > PelinZF=sum(abs(y-aklinZF)/2); > errorZF=PelinZF/N; > > %semilogy(RSBdB, PelinZF,'r*'); hold on;
Just read the definition for "filter" and you'll see how the coefficients are used. The coefficients are "h" and are *inputs* to the function..... Fred
Reply by August Reno December 8, 20052005-12-08
Hello All!
I obtained a matlab code which do the zero forcing equalization on
an awgn channel, and plots the BER vs. SNR
Please look at this small  code if it is correct, my question is:
where are the filter coefficients here or how can I obtain this, as I don't 
see them ???
Thanks for you effort,
Reno


N: number of symbols we transmit
h: impulse response
snrDB: SNR in dB, actually:
snrdB_min = 1; snrdB_max = 10;
snrdB = snrdB_min:1:snrdB_max;
-----

function z = zf(N,h,snrdB)

lg=length(h);
y=sign(randn(1,N));
sk=filter(h,1,y);
snr=10.^(snrdB/10);

nu=normrnd(0,(1/sqrt(snr)),1,N);
x=sk+nu;
ykegalZF=filter(1,h,x);
aklinZF=sign(ykegalZF(1:N));
PelinZF=sum(abs(y-aklinZF)/2);
errorZF=PelinZF/N;

%semilogy(RSBdB, PelinZF,'r*'); hold on;

-------