{"id":2477,"date":"2015-01-06T04:52:14","date_gmt":"2015-01-06T04:52:14","guid":{"rendered":"http:\/\/www.raymaps.com\/?p=2477"},"modified":"2015-01-06T11:24:20","modified_gmt":"2015-01-06T11:24:20","slug":"sum-of-sinusoids-fading-simulator","status":"publish","type":"post","link":"https:\/\/www.raymaps.com\/index.php\/sum-of-sinusoids-fading-simulator\/","title":{"rendered":"Sum of Sinusoids Fading Simulator"},"content":{"rendered":"<p style=\"text-align: justify;\">We have previously looked at frequency domain fading simulators i.e. simulators that define the Doppler components in the frequency domain and then perform an IDFT to get the time domain signal. These simulators include Smith\u2019s Simulator, Young\u2019s Simulator and our very own Computationally Efficient Rayleigh Fading Simulator. Another technique that has been widely reported in the literature is Sum of Sinusoids Method. As the name suggests this method generates the Doppler components in the time domain and then sums them up to generate the time domain fading envelope. There are three parameters that define the properties of the generated signal.<\/p>\n<p style=\"text-align: justify;\">1) Number of sinusoids \u2013 Higher the number better the properties of the generated signal but greater the computational complexity<br \/>\n2) Angle of arrival \u2013 This can be generated statistically or deterministically, spread from \u2013pi to pi.<br \/>\n3) Phase of the arriving wave \u2013 This is uniformly distributed between \u2013pi and pi.<\/p>\n<p>The MATLAB code below gives three similar sum of sinusoids techniques for generating a Rayleigh faded envelope [1].<\/p>\n<pre lang=\"Matlab\">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\n% SUM OF SINUSOIDS FADING SIMULATORS\r\n% fd - Doppler frequency  \r\n% fs - Sampling frequency\r\n% ts - Sampling period\r\n% N - Number of sinusoids\r\n%\r\n% www.raymaps.com\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\n\r\nclear all\r\nclose all\r\n\r\nfd=70;\r\nfs=1000000;\r\nts=1\/fs;\r\nt=0:ts:1;\r\nN=100;\r\n\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\n% Method 1 - Clarke\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\nx=zeros(1,length(t));\r\ny=zeros(1,length(t));\r\n\r\nfor n=1:N;n\r\n    alpha=(rand-0.5)*2*pi;\r\n    phi=(rand-0.5)*2*pi;\r\n    x=x+randn*cos(2*pi*fd*t*cos(alpha)+phi);\r\n    y=y+randn*sin(2*pi*fd*t*cos(alpha)+phi);\r\nend\r\nz=(1\/sqrt(N))*(x+1i*y);\r\nr1=abs(z);\r\n\r\nplot(t,10*log10(r1))\r\nhold on\r\n\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\n% Method 2 - Pop, Beaulieu\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\nx=zeros(1,length(t));\r\ny=zeros(1,length(t));\r\n\r\nfor n=1:N;n\r\n    alpha=2*pi*n\/N;\r\n    phi=(rand-0.5)*2*pi;\r\n    x=x+randn*cos(2*pi*fd*t*cos(alpha)+phi);\r\n    y=y+randn*sin(2*pi*fd*t*cos(alpha)+phi);\r\nend\r\nz=(1\/sqrt(N))*(x+1i*y);\r\nr2=abs(z);\r\n\r\nplot(t,10*log10(r2),'r')\r\nhold on\r\n\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\n% Method 3 - Chengshan Xiao\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\nx=zeros(1,length(t));\r\ny=zeros(1,length(t));\r\n\r\nfor n=1:N;n\r\n    phi=(rand-0.5)*2*pi;\r\n    theta=(rand-0.5)*2*pi;\r\n    alpha=(2*pi*n+theta)\/N;\r\n    x=x+randn*cos(2*pi*fd*t*cos(alpha)+phi);\r\n    y=y+randn*sin(2*pi*fd*t*cos(alpha)+phi);\r\nend\r\nz=(1\/sqrt(N))*(x+1i*y);\r\nr3=abs(z);\r\n\r\nplot(t,10*log10(r3),'g')\r\nhold off\r\n\r\nxlabel('Time(sec)')\r\nylabel('Envelope(dB)')\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\n<\/pre>\n<p style=\"text-align: justify;\">All the three techniques given above are quite accurate in generating a Rayleigh faded envelope with the desired statistical properties. The accuracy of these techniques increases as the number of sinusoids goes to infinity (we have tested these techniques with up to 1000 sinusoids but realistically speaking even 100 sinusoids are enough). If we want to compare the three techniques in terms of the Level Crossing Rate (LCR) and Average Fade Duration (AFD) we can say that the first and third technique are a bit more accurate than the second technique. Therefore we can conclude that a statistically distributed angle of arrival is a better choice than a deterministically distributed angle of arrival. Also, if we look at the autocorrelation of the in-phase and quadrature components we see that for the first and third case we get a zero order Bessel function of the first kind whereas for the second case we get a somewhat different sequence which approximates the Bessel function with increasing accuracy as the number of sinusoids is increased.<\/p>\n<figure id=\"attachment_2484\" aria-describedby=\"caption-attachment-2484\" style=\"width: 762px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.raymaps.com\/index.php\/sum-of-sinusoids-fading-simulator\/besselj\/\" rel=\"attachment wp-att-2484\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-2484\" src=\"http:\/\/www.raymaps.com\/wp-content\/uploads\/2015\/01\/Besselj.jpeg\" alt=\"Correlation of Real and Imaginary Parts\" width=\"762\" height=\"296\" srcset=\"https:\/\/www.raymaps.com\/wp-content\/uploads\/2015\/01\/Besselj.jpeg 1055w, https:\/\/www.raymaps.com\/wp-content\/uploads\/2015\/01\/Besselj-300x117.jpeg 300w, https:\/\/www.raymaps.com\/wp-content\/uploads\/2015\/01\/Besselj-1024x398.jpeg 1024w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><\/a><figcaption id=\"caption-attachment-2484\" class=\"wp-caption-text\">Correlation of Real and Imaginary Parts<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">The above figures show the theoretical Bessel function versus the autocorrelation of the real\/imaginary part \u00a0generated by method number two. The figure on the left considers 20 sinusoids whereas the figure on the right considers 40 sinusoids. As can be seen the accuracy of the autocorrelation sequence increases considerably by doubling the number of sinusoids. We can assume that for number of sinusoids exceeding 100 i.e. N=100 in the above code the generated autocorrelation sequence would be quite accurate.<\/p>\n<p>[1] Chengshan Xiao, \u201cNovel Sum-of-Sinusoids Simulation Models for Rayleigh and Rician Fading Channels,\u201d IEEE TRANSACTIONS ON WIRELESS COMMUNICATIONS, VOL. 5, NO. 12, DECEMBER 2006.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have previously looked at frequency domain fading simulators i.e. simulators that define the Doppler components in the frequency domain and then perform an IDFT to get the time domain signal. These simulators include Smith\u2019s Simulator, Young\u2019s Simulator and our very own Computationally Efficient Rayleigh Fading Simulator. Another technique that has been widely reported in the literature is Sum of Sinusoids Method. As the name suggests this method generates the Doppler components in the time domain and then sums them up to generate the time domain fading envelope. There are three parameters that define the properties of the generated signal. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[56,58,57,64,59],"class_list":["post-2477","post","type-post","status-publish","format-standard","hentry","category-chanmod","tag-channel","tag-fading","tag-multipath","tag-rayleigh","tag-rayleigh-fading"],"_links":{"self":[{"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/posts\/2477","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/comments?post=2477"}],"version-history":[{"count":10,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/posts\/2477\/revisions"}],"predecessor-version":[{"id":2488,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/posts\/2477\/revisions\/2488"}],"wp:attachment":[{"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/media?parent=2477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/categories?post=2477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/tags?post=2477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}