Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

can any one remove the errors in this code of matlab

Status
Not open for further replies.

shoaib19

Newbie level 2
Newbie level 2
Joined
Mar 27, 2015
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
127

Code dot - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
% ENGINEER SHOAIB MUSHTAQ  M.SHERYAR QAZI   MUZZAMMIL AHMED
% ENGINEER SHOAIB MUSHTAQ  M.SHERYAR QAZI   MUZZAMMIL AHMED
% MIMO-OFDM CCDF CURVES
 
 
clear
clc
AoD = 2*pi;   %Angle of Departure
AoA = 2*pi;   %Angle of Arrival
dt  = 0.3;   %antenna separations at transmiter in lambda 
dr  = 0.3;   %antenna separations at receiver in lambda
nt_v=[2 4 8];
nr_v=[2 4 8];
noise_variance=1e-4;%Noise Variance
SNR_db_v=0:2:10;%SNR Vector in db
SNR_v=10.^((SNR_db_v)/10);%db to power conversion
%for k=1
    nt = nt_v(1);
    nr = nr_v(1);
for i=1:length(SNR_v)
        Pt=noise_variance*SNR_v(i);%total power 
for j=1:10000
         [TCM ,RCM , CCM , MCM ] = ChannelEstimation( nt,nr,dt,dr,AoD,AoA);
        ChannelMatrix=MCM;
        [Capacity_WF(i,j),Capacity(i,j)]=waterfilling(ChannelMatrix,Pt,noise_variance);%applying water filling
end
end
 
 
%end
C1=(Capacity_WF(1,:));
C2=(Capacity_WF(2,:));
C3=(Capacity_WF(3,:));
C4=(Capacity_WF(4,:));
C5=(Capacity_WF(5,:));
C6=(Capacity_WF(6,:));
[a,b]=hist(C1,25);
[c,d]=hist(C2,25);
[e,f]=hist(C3,25);
[g,h]=hist(C4,25);
[i,j]=hist(C5,25);
[k,l]=hist(C6,25);
a=a/sum(a);
c=c/sum(c);
e=e/sum(e);
g=g/sum(g);
i=i/sum(i);
k=k/sum(k);
f1=figure(1)
 
plot(b,1-cumsum(a),'-ob',d,1-cumsum(c),'-*r',f,1-cumsum(e),'->m',h,1-cumsum(g),'-<g',...
                    j,1-cumsum(i),'-sk',l,1-cumsum(k),'-^c','LineWidth',2);
 
xlabel('Capacity (bps/Hz)')
ylabel('Probability (Capacity(bps/Hz))')
grid on
set(f1,'color',[1 1 1])
hold off
 
 
function [TCM ,RCM ,CCM ,MCM ] = ChannelEstimation( Ntx,Nrx,dt,dr,AOD,AOA)
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
% ENGINEER SHOAIB MUSHTAQ  M.SHERYAR QAZI   MUZZAMMIL AHMED
% ENGINEER SHOAIB MUSHTAQ  M.SHERYAR QAZI   MUZZAMMIL AHMED
 
 
%MIMO CHANNEL ESTIMATION
 
% OUTPUT VARIABLES 
%  TCM = Transmitter Correlation Matrix
%  RCM = Receiver Correlation Matrix
%  CCM = Channel Covariance Matrix
%  MCM = MIMO Channel Matrix 
% INPUT VARIABLES
%  Ntx = No of trasmit antennas
%  Nrx = No of receive antennas
%  dt  = antenna seperation at transmitter in lambda
%  dr  = antenna seperation at receiver in lambda
%  AOA = angle of departure in radians
%  AOA = angle of arrival in radians
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    
 
% Initializing
 Pr=zeros(Nrx,Ntx);
 Pt=zeros(Nrx,Ntx);
 vec_r=zeros(1,Nrx*Ntx);
 H=zeros(Nrx,Ntx);
 
% Receiver Correlation Matrix Generation
 
for i=1:Nrx;
for j=1:Nrx;
            Pr(i,j)=besselj(0,AOA*dr*abs(j-i));
end;
end;
 
RCM=Pr;
 
% Transmitter Correlation Matrix Generation
 
for i=1:Ntx;
for j=1:Ntx;
            Pt(i,j)=besselj(0,AOD*dt*abs(j-i));
end;
end;
 
TCM=Pt;
 
% Channel Covariance Matrix Generation
 
 
CCM=kron(Pt,Pr);
 
% MIMO Channel Matrix Generation
 
    [V,D] = eig(CCM);
    G=V*sqrt(D);
    r=random('rician',1,Nrx,Ntx);
for j=1:Ntx;
for i=1:Nrx;
            vec_r(i+(j-1)*Nrx)=r(i,j);
end;
end;
 
    vec_H=G*vec_r';
for j=1:Ntx;
for i=1:Nrx;
           H(i,j)=vec_H(i+(j-1)*Nrx);
end;
end;
 
MCM=H;
 
 
 
 
end
 
 
 
% ENGINEER SHOAIB MUSHTAQ  M.SHERYAR QAZI   MUZZAMMIL AHMED
% ENGINEER SHOAIB MUSHTAQ  M.SHERYAR QAZI   MUZZAMMIL AHMED
 
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%INITIALIZING%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
clear
clc
AoD     =   0:pi/3:2*pi;         %Angle of Departure
AoA     =   0:pi/3:2*pi;         %Angle of Arrival
dt_vec      =   [0.2 0.3 0.4 0.5];   %antenna separations at transmiter in lambda 
dr_vec      =   [0.2 0.3 0.4 0.5];   %antenna separations at receiver in lambda
color = ['-ob';'->r';'-*m';'-^g';];
numTx   =   2;                   % number of transmit antennas
numRx   =   2;                   %number of receive antennas
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for i=1:4
    dt = dt_vec(i);
    dr = dr_vec(i);
 
for j=1:length(AoD)
 
    [TCM ,RCM , CCM , MCM ] = ChannelEstimation( numTx,numRx,dt,dr,AoD(j),AoA(j));
 
 
            a_12(j)=RCM(1,2)
            b_12(j)=TCM(1,2)
 
 
 
end
 
    f1 = figure(1);
    hold on
   plot(AoD,a_12,color(i,:),'LineWidth',2);
 
    axis([0 2*(pi) -1 1])
    grid on
    set(f1,'color',[1 1 1])
    set(gca,'xtick',0:pi/3:2*(pi));
 
    set(gca,'xticklabel',{'0', '60' , ...
'120', '180','240','300',' 360'})
 
    xlabel('Angle of Departure/Arrival in Degree')
    ylabel('Transmitter/Receiver Spatial Correlation Coefficient')
    hold off
 
 
end
 
 
 
%OFDM modulation of one subframe of random uniformly-distributed noise,
%   using a 10MHz 2-antenna configuration.
    clc
 
    enb = struct('NDLRB',6,'CyclicPrefix','Normal','CellRefP',2)
    dims = lteDLResourceGridSize(enb)
    grid = complex(rand(dims)-0.5,rand(dims)-0.5);
    waveform = lteOFDMModulate(enb,grid)
    plot(real(10*log10(fft(waveform))))
 
 
 
% ENGINEER SHOAIB MUSHTAQ  M.SHERYAR QAZI   MUZZAMMIL AHMED
% ENGINEER SHOAIB MUSHTAQ  M.SHERYAR QAZI   MUZZAMMIL AHMED   
 
% MIMO-OFDM System (Transmiter----MIMO_Channel----Receiver)
 
 
 
 
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%Initializing%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                            
clc
clear
    n              =   256;    % Number of bits to process
    M              =   16;     % Size of signal constellation
    s              =   64;     %total number of subcarriers
    k              =   log2(M);% Number of bits per symbol
    Guard_Interval =   s/4;    % Guard interval length
    numTx          =   2;      % number of transmit antennas
    numRx          =   2;      %number of receive antennas
    Rs             =   20e6;   %Signal Sample Rate  20MHz(LteSpecification)
    maxDopp        =   30;     %MaximumDopplerShift
    SNR            =   20;     %SNR in db
    tu             =   3.2e-6; %useful symbol period
    tg             =   0.8e-6; %guard interval length
    ts             =   tu+tg;  %total symbol duration
    scb            =   312.5e3;%sub carrier spacing
    fc             =   3.6e9;  %carrier frequency
    AoD            =   2*pi;   %Angle of Departure
    AoA            =   2*pi;   %Angle of Arrival
    dt             =   0.20;   %antenna separations at transmiter in lambda 
    dr             =   0.15;   %antenna separations at receiver in lambda
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%Transmitter%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                        
 
%----------------------------%DATA GENERATION-----------------------------%
 
x= randi([0 1],n,1) 
xsym = bi2de(reshape(x,k,length(x)/k).','left-msb');
 
%------------------------SYMBOLS MAPPING (16-QAM)-------------------------% 
 
QAM16_Modulator = comm.RectangularQAMModulator(16,...
'NormalizationMethod','Average power',...
'SymbolMapping', 'Custom', ...
'CustomSymbolMapping',...
                         [11 10 14 15 9 8 12 13 1 0 4 5 3 2 6 7]);
 
mod_sig = step(QAM16_Modulator ,xsym);% Mapping(16-QAM Modulation)
 
%------------------------MIMO OSTBC (ALAMOUTI)----------------------------%
 
hAlamoutiEnc = comm.OSTBCEncoder(...
'NumTransmitAntennas',2);
 
encData = step(hAlamoutiEnc, mod_sig);%MIMO Coding(ALAMOUTI)
 
%------------------------OFDM MODULATION(IFFT)----------------------------%
 
x1=encData(:,1); %data stream 1
x2=encData(:,2); %data stream 2
%x3=encData(:,3); %data stream 3
%x4=encData(:,4); %data stream 4
 
Data_IFFT1=ifft(x1,s);%OFDM Modulation(IFFT)on data stream 1
Data_IFFT2=ifft(x2,s);%OFDM Modulation(IFFT)on data stream 2 
%Data_IFFT3=ifft(x3,s);%OFDM Modulation(IFFT)on data stream 3
%Data_IFFT4=ifft(x4,s);%OFDM Modulation(IFFT)on data stream 4
 
%------------------------CYCLIC PREFIXING---------------------------------%
 
OFDM_Sym1= [Data_IFFT1(s- Guard_Interval + 1 : s);Data_IFFT1]; 
OFDM_Sym2= [Data_IFFT2(s- Guard_Interval + 1 : s);Data_IFFT2];
 
%OFDM_Sym3= [Data_IFFT3(s- Guard_Interval + 1 : s);
%OFDM_Sym4= [Data_IFFT4(s- Guard_Interval + 1 : s);
 
%---------------------DIGITAL TO ANALOG CONVERSION------------------------%
 
tt=0:  5.0000e-08:ts- 5.0000e-08;
OFDM_BPS1=(OFDM_Sym1'.*(exp(1j*2*pi*fc*tt)));
OFDM_BPS1=OFDM_BPS1';
OFDM_BPS2=(OFDM_Sym2'.*(exp(1j*2*pi*fc*tt)));
OFDM_BPS2=OFDM_BPS2';
%OFDM_BPS3=(OFDM_Sym3'.*(exp(1j*2*pi*fc*tt)));
%OFDM_BPS3=OFDM_BPS3'
%OFDM_BPS4=(OFDM_Sym4'.*(exp(1j*2*pi*fc*tt)));
%OFDM_BPS4=OFDM_BPS4'
 
Data=horzcat(OFDM_BPS1,OFDM_BPS2);
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%Channel%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[TCM ,RCM , CCM , MCM ] = ChannelEstimation( numTx,numRx,dt,dr,AoD,AoA);
 
hChan = comm.MIMOChannel(...
'SampleRate',               Rs,...
'MaximumDopplerShift',      maxDopp,...
'TransmitCorrelationMatrix',TCM,...
'ReceiveCorrelationMatrix', RCM,...
'PathGainsOutputPort',      true);  
 
AWGN= comm.AWGNChannel(...
'NoiseMethod', 'Signal to noise ratio (SNR)',...
'SNR',SNR,...
'SignalPower', 1);
 
[chanOut, pathGains] = step(hChan,Data); % MIMO Rayleigh Fading Channel 
rx= step(AWGN, chanOut); %Adding AWGN noise 
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%Receiver%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
%-----------------------------SIGNAL RECEPTION----------------------------%
 
rxSignal=rx;
y1=rxSignal(:,1); %received data frrom antenna 1
y2=rxSignal(:,2); %received data frrom antenna 2
 
%---------------------ANALOG TO DIGITAL CONVERSION------------------------%
 
OFDM_rx1=(y1'.*(exp(1j*2*pi*fc*tt)));
OFDM_rx1=OFDM_rx1';
OFDM_rx2=(y2'.*(exp(1j*2*pi*fc*tt)));
OFDM_rx2=OFDM_rx2';
 
%------------------------REMOVING CYCLIC PREFIX---------------------------%
 
Data1_Removeal_Gaurd  = OFDM_rx1(Guard_Interval+1:s+Guard_Interval); 
Data2_Removeal_Gaurd  = OFDM_rx2(Guard_Interval+1:s+Guard_Interval);
 
%------------------------OFDM DEMODULATION (FFT)--------------------------%
 
Data_FFT1=fft(Data1_Removeal_Gaurd ,s);
Data_FFT2=fft(Data2_Removeal_Gaurd,s);
g=zeros(16,1);
Data_ZP1=[g;Data_FFT1];
Data_ZP2=[g;Data_FFT2];
Data2=horzcat(Data_ZP1,Data_ZP2);
 
%---------------------MIMO DECODING(ALAMOUTI DECODING)--------------------%
 
 
hAlamoutiDec =comm.OSTBCCombiner(...
'NumTransmitAntennas',2,...
'NumReceiveAntennas', 2);
 
decData = step(hAlamoutiDec, Data2,squeeze(pathGains));
decData_rzp=decData(length(g)+1:s+Guard_Interval);
 
 
%-----------------SYMBOLS DECODING(16-QAM DEMODULATION)-------------------%
 
QAM16_DeModulator = comm.RectangularQAMDemodulator(...
'ModulationOrder', 16, ...
'NormalizationMethod', 'Average power',...
'SymbolMapping', 'Custom', ...
'CustomSymbolMapping',...
                         [11 10 14 15 9 8 12 13 1 0 4 5 3 2 6 7]);
 
 
 zsym = step(QAM16_DeModulator ,decData_rzp);
 
%-----------------OBTAINING BINARY INFORMATION----------------------------%
 
 
 z = de2bi(zsym,'left-msb');%Convert integers to bits
 z = reshape(z.',numel(z),1)%
 
 
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%BIT ERROR RATE ANALYSIS%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
hError = comm.ErrorRate;
q = step(hError,x,z)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
% ENGINEER SHOAIB MUSHTAQ  M.SHERYAR QAZI   MUZZAMMIL AHMED
% ENGINEER SHOAIB MUSHTAQ  M.SHERYAR QAZI   MUZZAMMIL AHMED
 
 
clear
clc
AoD = 2*pi;   %Angle of Departure
AoA = 2*pi;   %Angle of Arrival
dt  = 0.3;   %antenna separations at transmiter in lambda 
dr  = 0.3;   %antenna separations at receiver in lambda
nt_v=[2 4 8];
nr_v=[2 4 8];
color = ['-ob';'->r';'-*m'];
color1 = ['-^g';'-sk';'-*y'];
noise_variance=1e-4;%Noise Variance
SNR_db_v=-10:3:20;%SNR Vector in db
SNR_v=10.^((SNR_db_v)/10);%db to power conversion
for k=1:3
    nt = nt_v(k);
    nr = nr_v(k);
for i=1:length(SNR_v)
        Pt=noise_variance*SNR_v(i);%total power 
for j=1:1000
         [TCM ,RCM , CCM , MCM ] = ChannelEstimation( nt,nr,dt,dr,AoD,AoA);
        ChannelMatrix=MCM;
        [Capacity_WF(i,j),Capacity(i,j)]=waterfilling(ChannelMatrix,Pt,noise_variance);%applying water filling
end
end
%%plotting the curves of capacity
    f1 = figure(1);
    hold on
    plot(SNR_db_v,mean(Capacity'),color(k,:),SNR_db_v,mean(Capacity_WF'),color1(k,:),'LineWidth',2);
end
 
    grid on
    set(f1,'color',[1 1 1])
    xlabel('SNR in dB')
    ylabel('Capacity bits/s/Hz')
 
    hold off
 
function [P] = Powerr(threshold,noiseVariance,temp,j)
 
% ENGINEER SHOAIB MUSHTAQ  M.SHERYAR QAZI   MUZZAMMIL AHMED
% ENGINEER SHOAIB MUSHTAQ  M.SHERYAR QAZI   MUZZAMMIL AHMED   
 
%Calculating the optimal power for each channel
 
        P=threshold-(noiseVariance/temp(j));
end
 
    function [ th ] = threshold( gain_2,totalPower,noiseVariance,rank )
 
 
% ENGINEER SHOAIB MUSHTAQ  M.SHERYAR QAZI   MUZZAMMIL AHMED
% ENGINEER SHOAIB MUSHTAQ  M.SHERYAR QAZI   MUZZAMMIL AHMED
 
%Calculating the value of inverse of Lagrange multiplier that is the
%threshold value
 
    temp_2=0;
for i=1:rank
    temp_2=temp_2+(noiseVariance/gain_2(i));
 
end
th=(totalPower+temp_2)/rank;
end
 
 
function[ Capacity,Capacity_1]= waterfilling( channelMatrix,totalPower,noiseVariance )
 
 
% ENGINEER SHOAIB MUSHTAQ  M.SHERYAR QAZI   MUZZAMMIL AHMED
% ENGINEER SHOAIB MUSHTAQ  M.SHERYAR QAZI   MUZZAMMIL AHMED 
%Water filling Algorithm for optimal power allocation in MIMO-OFDM
%System%
 
    [U D V]=svd(channelMatrix);
    gain=diag(D);
    rank=nnz(gain);
    temp=gain.^2;
    j=rank;
    l=rank;
    p = zeros(1,rank);
 
while(rank>0)
        th=threshold(temp,totalPower,noiseVariance,rank);
        p(j)=Powerr(th,noiseVariance,temp,j);
 
if (p(j)>=0)
for k=rank-1:-1:1;
                p(k)=Powerr(th,noiseVariance,temp,k);
 
end
break
else
            p(j)=0;
            rank=rank-1;         
            j=j-1;
 
end
 
end
%%Calculating channel Capacity with Water Filling
            Capacity=0;
for i=1:1:l
                Capacity=Capacity+(log2(1+((temp(i)*p(i))/(noiseVariance))));
end
            shanoncapacity=sprintf('Capacity with Waterfilling are = %f bits/sec/Hz %s',Capacity);
%%Calculating channel Capacity with Out Water Filling
            Capacity_1=0;
            P=totalPower/l;
for i=1:1:l
                Capacity_1=Capacity_1+(log2(1+((temp(i)*P)/(noiseVariance))));
end
            shanoncapacity_1=sprintf('Capacity with out Waterfilling are = %f bits/sec/Hz %s',Capacity_1);

 
Last edited by a moderator:

can you post what error message you are getting on your Matlab compiler screen??. run the program and post the error you get.
 

can you post what error message you are getting on your Matlab compiler screen??. run the program and post the error you get.

i attached the pdf file in this file plz you can copy the code see the error and if possible plz remove error and send it to me
 

Attachments

  • thesis final with improvements (hassan).pdf
    2.2 MB · Views: 210

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top