Preview

Dynamic Spectrum Access (DSA) in Wireless Cognitive Radio Networks (WCRN)

Good Essays
Open Document
Open Document
846 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Dynamic Spectrum Access (DSA) in Wireless Cognitive Radio Networks (WCRN)
Cognitive Radio Matlab Source Code

clc close all t = 0:0.00001:0.001;
Fc1 = 1000;
Fc2 = 2000;
Fc3 = 3000;
Fc4 = 4000;
Fc5 = 5000;
Fs = 12000;

y1 = 1; y2 = 0; y3 = 0; y4 = 0; y5 = 0; Y = 0; y = 0;

x1 = cos(2*pi*1000*t);

in_p = input('\nDo you want to enter first primary user Y/N: ','s');

if(in_p == 'Y' | in_p == 'y')

y1 = ammod(x1,Fc1,Fs);

end

in_p = input('Do you want to enter second primary user Y/N: ','s');

if(in_p == 'Y' | in_p == 'y')

y2 = ammod(x1,Fc2,Fs);

end

in_p = input('Do you want to enter third primary user Y/N: ','s');

if(in_p == 'Y' | in_p == 'y')

y3 = ammod(x1,Fc3,Fs);

end

in_p = input('Do you want to enter fourth primary user Y/N: ','s');

if(in_p == 'Y' | in_p == 'y')

y4 = ammod(x1,Fc4,Fs);

end

in_p = input('Do you want to enter fifth primary user Y/N: ','s');

if(in_p == 'Y' | in_p == 'y')

y5 = ammod(x1,Fc5,Fs);

end

y = y1 + y2 + y3 + y4 + y5;

while(1)

Pxx = periodogram(y);

Hpsd = dspdata.psd(Pxx,'Fs',Fs);

plot(Hpsd);

in_p = input('\nDo you want to enter a secondary user Y/N: ','s');

if(in_p == 'Y' | in_p == 'y')

tp=0;

chek1 = Pxx(25)*10000;

chek2 = Pxx(46)*10000;

chek3 = Pxx(62)*10000;

chek4 = Pxx(89)*10000;

chek5 = Pxx(105)*10000;

if(chek1 < 8000)

disp('Assigned to User 1 as it was not present.');

y1 = ammod(x1,Fc1,Fs);

elseif (chek2 < 8000)

disp('Assigned to User 2 as it was not present.');

y2 = ammod(x1,Fc2,Fs);

elseif(chek3 < 8000)

disp('Assigned to User 3 as it was not present.');

y3 = ammod(x1,Fc3,Fs);

elseif(chek4 < 8000)

disp('Assigned to User 4 as it was not present.');

y4 = ammod(x1,Fc4,Fs);

elseif(chek5 < 8000)

disp('Assigned to User 5 as it was not present.');

y5 = ammod(x1,Fc5,Fs);

else

disp('all user slots in use. try again later,');

tp=1;

end

figure

y = y1 + y2 + y3 + y4 + y5 ;

Pxx = periodogram(y);

Hpsd =

You May Also Find These Documents Helpful

  • Powerful Essays

    If x =4, y=2, z=3, then what is the value of y after first round of step 3?…

    • 1942 Words
    • 8 Pages
    Powerful Essays
  • Good Essays

    Psy/315 Week 4

    • 631 Words
    • 3 Pages

    0, 1, 1, 3, 0, 0, 2, 5, 0, 1, 1, 2, 0, 1, 1…

    • 631 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    = 1 x 210 + 0 x 29 + 1 x 28 + 0 x 27 + 0 x 26 + 0 x 25 + 0 x 24 + 1 x 23 + 1 x 22 + 1 x 21 + 1 x 20…

    • 780 Words
    • 10 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Solving Proportions

    • 379 Words
    • 2 Pages

    Then you would add 1 to both sides to isolate the y and simplify the right side. This process would eliminate a few steps from the traditional…

    • 379 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Hawaiian Estate Case Study

    • 2762 Words
    • 12 Pages

    Model 1: Y = β0 + β1X1 + β2X2 + β3X1X2 + β4X12 + β5X12X2 + ε…

    • 2762 Words
    • 12 Pages
    Good Essays
  • Satisfactory Essays

    MAT1300 FInal

    • 1456 Words
    • 6 Pages

    x + 1 ; (B) y = x + 3 ; (C) y = x + 7 ; (D) y = x + 2 ; (E) y = x − 1 .…

    • 1456 Words
    • 6 Pages
    Satisfactory Essays
  • Good Essays

    2, 2, 0, 5, 1, 4, 1, 3, 0, 0, 1, 4, 4, 0, 1, 4, 3, 4, 2, 1, 0…

    • 1337 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    econ 513 final exam

    • 2264 Words
    • 10 Pages

    Suppose that y1 , y2 , y3 , z1 , z2 are random variables that satisfy that…

    • 2264 Words
    • 10 Pages
    Satisfactory Essays
  • Better Essays

    Answer to Question 1 a. What is the trend of murder 1960-2012?-The rate of murder over the years remained fairly constant and only slight changes were reported. The rate of murder in 1960 is almost equal to that in 2012. b. How can one explain the trend of Forcible Rape? - From the 1960s up to 1990 the rate of forcible started going down. This is attributable to the increase in police vigilance, community police, and the possible increase in the jail terms for forcible rape.…

    • 1012 Words
    • 5 Pages
    Better Essays
  • Good Essays

    0 |0 |1 |1 |1 |1 |1 |1 |1 |1 |2 |2 |2 |3 |3 |3 |3 |4 |4 |4 |4 |4 |4 |4 |5 |5 |5 |6 |6 |7 | |(Values arranged in ascending order, 3 is the value in the middle of the series)…

    • 1433 Words
    • 6 Pages
    Good Essays
  • Good Essays

    Edgar Allan Poe and Washington Irving are both enthralling writers. They both have unusual styles of writing but they are similar in some ways. The writers are comparable in the use of tone in their works. Irving‘s use of tone in his stories are typically optimistic, yet dramatic. Poe’s uses of tone in his stories are filled with horror and are also dramatic. Poe and Irving use different techniques to develop a complex meaning in their short stories. For instance, elements such as imagery, tone, and irony are placed in these stories contribute to make these stories intense.…

    • 751 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Rhetorical Analysis of Romeo and Juliet Shakespeare. He grew up in Stratford, England, and dedicated his life to work at the Globe, where he made many plays and stories. Shakespeare wanted couples to appreciate their love because love can be very dry and unwilling to sacrifice themselves for their spouse, so he wrote this wonderful story. Romeo and Juliet had a purpose and a reason for its existence in the literature world. The purpose of Romeo and Juliet is never to rush love, as shown by the character's emotions, their choices, and the unique plot.…

    • 592 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Math Portfolio

    • 1029 Words
    • 5 Pages

    This means that the function will stay y=xn but here only n will change. The parameters will stay the same a=0 and b=1.…

    • 1029 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Casestudy3

    • 608 Words
    • 6 Pages

    A Linear Mathematical Program was created. The program was then entered into Excel, and solved using Excel solver.…

    • 608 Words
    • 6 Pages
    Satisfactory Essays
  • Powerful Essays

    AMRE

    • 2960 Words
    • 12 Pages

    -100 . . . . . . . . . 0 . . . . . . . . . 100…

    • 2960 Words
    • 12 Pages
    Powerful Essays