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.

what is the (temp) refereed to?

Status
Not open for further replies.

nuha

Newbie level 1
Joined
Dec 19, 2016
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
6
Code:
% Array storing theoretical value of Pf for AND logic decison rule
    PfAND = [];
    % Array storing simulated value of Pd for AND logic decison rule  
    PdSimulAND = [];
    % Array storing simulated value of Pf for AND logic decison rule  
    PfSimulAND = [];
    NormalizedThrptAND = [];
    for k=1:1:length(tau)
        % Number of samples in the sensiing duration        
        N = ceil((Fs/T)*tau(k));
        PftheoryOR = 0;countsOR = 0;countnOR = 0;
        PftheoryAND = 0;countsAND = 0;countnAND = 0;   
        for j=1:1:NMonteCarlo
            % Generating Random Data
            Data = randint(1,N,4);
            % Modulated signal
            mod_sig=pskmod(Data,4);
            % Finding Epsilon for this frame
            h = ones(M,1);
            % AWGN Channel
            N0 = 1/(10^(AvgSNR/10));
            Tyis = zeros(M,1);
            Tyin = zeros(M,1);
            % finding the decision statistic            
            for f=1:1:M
                Noise = sqrt(N0)*((randn(1,N)+sqrt(-1)*randn(1,N))/sqrt(2));
                Tyis(f) = sum((abs(h(f)*mod_sig + Noise)).^2)/N;
                Tyin(f) = sum((abs(Noise)).^2)/N;
            end
            %------------------------OR------------------------------------
            % Finding the epsiloon for OR decision rule and then finding
            % the net probability of false alarm            
            Pdi = 1 - (0.1)^(1/M);
            epsilon = zeros(M,1);
            for f=1:1:M
                epsilon(f) = ((qfuncinv(Pdi)*sqrt(1+2*abs(h(f))*abs(h(f))*10^(AvgSNR/10)))/(sqrt(N)) + 1 + abs(h(f))*abs(h(f))*10^(AvgSNR/10))/10^(AvgSNR/10);
            end
            for f=1:1:M
                if(Tyin(f)>epsilon(f))
                    countnOR = countnOR + 1;
                    break;
                end
            end
            for f=1:1:M
                if(Tyis(f)>epsilon(f))
                    countsOR = countsOR + 1;
                    break;
                end
            end      
            temp = 1;
            for f=1:1:M
                temp = temp*(1 - qfunc(((epsilon(f)*10^(AvgSNR/10)) - 1)*sqrt(N)));
            end
            PftheoryOR = PftheoryOR + (1 - temp);
 
Last edited by a moderator:

We need a much vaguer post. Please don't include any important information like what language you're using, what you're expecting and what the actual problem is.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top