RDsims - Author Andrew Harms Date Copyright(c 2013 by...

This preview shows page 1 - 3 out of 7 pages.

% Author: Andrew Harms % Date: 03/31/2013 % Copyright (c) 2013 by Andrew Harms. This work is made available under % the terms of the Creative Commons Attribution-ShareAlike 3.0 license function y =... RDsims(num, Wvec, Rvec, Kvec, dvec, kvec, SNR, rllseq, input, ident) % Simulations of Random Demodulator(RD) using RLL sequences. % Reconstruction is done using Basis Pursuit and the 'yall1' package. % % 'num' is the number of iterations to run for each set of parameters. % % Use Wvec, Rvec, Kvec, dvec, and kvec for the desired parameter % W, R, K, d, and k to run. Note: 'dvec' and 'kvec' must be of equal % length. % % 'rllseq' specifies what type of random chipping sequence to use: % 'general' % 'repcode' % % 'input' specifies whether to use a matched input signal distribution % or a uniform input signal distribution % % 'ident' is an identifier for the saved file addpath('./YALL1-b6/'); addpath('./SpaRSA_2/'); savefile = ['./tempdata/tempsavefile' num2str(ident)]; verbose = 0; % Produce extra logs to the MATLAB command line % number of iterations for each 4-tuple (K,R,W,d) num_iter = num; % RD Parameters W_vec = Wvec; % DFT (signal) size R_vec = Rvec; % Sampling rate K_vec = Kvec; % Sparsity level % RLL sequence parameters: [d,k]-code d_vec = dvec; % min parameter k_vec = kvec; % max parameter threshold = 10^(-4); % Desired precision for reconstruction % Multi-dim matrix for storing success probability values, or MSE for the % noisy case, for (K,R,W,d) prob_success_K_R_W_d =... zeros(length(K_vec),length(R_vec),length(W_vec),length(d_vec)); for var_W=1:length(W_vec) W = W_vec(var_W); % Create Unitary DFT matrix (size W x W) n=0:(W-1); m=0:(W-1); F=exp(2*pi*1i*n'*m/W)/sqrt(W); % Normalized DFT matrix if (W < R_vec(end)) R_ind = sum((R_vec==W).*(1:length(R_vec))); R_use = R_vec(1:R_ind); else R_use = R_vec; end for var_R=1:length(R_use) R = R_use(var_R);
Image of page 1
r = (W/R); if verbose disp(['Running now with (W,R)=(' num2str(W) ',' num2str(R) ')']); end % Create summation-operation matrix (size RxW) H = create_H_matrix(R,W); K_max = min(length(K_vec),floor(W)); for var_K=1:K_max K = K_vec(var_K); if verbose disp(['K = ' num2str(K)]); end for var_d=1:length(d_vec) d = d_vec(var_d); k = k_vec(var_d); % --------------------------------------------- num_success = 0; for iter=1:num_iter % -----Create Sensing Matrix------------------- % Create random sequence matrix D (size W x W) t = gen_rll_waveform(d,k,W,rllseq); % rll switching sequence D = diag(t); % diag matrix with switching sequence t % Create measurement matrix Phi = H*D*F; Phi = Phi/sqrt(r); % scale to orthonormal rows (for yall1) % -----Create a K-sparse (column) vector------- leakage = 0; [s s_index] = create_Ksparse_vector(W,K,input,leakage);
Image of page 2

Want to read all 7 pages?

Image of page 3

Want to read all 7 pages?

You've reached the end of your free preview.

Want to read all 7 pages?

  • Fall '15

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern