title: DCT based compressive sensing
body: <p>I need please to understand the following parts. </p>
  
  <pre><code>  **A=zeros(M,N);**
      **for k=1:M**
      **A(k,:)=dct(Phi(k,:));**
      **end**
  Result2 = BSBL_BO(A,y,groupStartLoc,0,'prune_gamma',-1, 'max_iters',20);
  </code></pre>
  
  <p>why does the author calculate the DCT of the sensing matrix Phi ?</p>
  
  <p>what I know is that </p>
  
  <p>y = Phi * DCT(x)
  Thus, we need to find DCT(x), not DCT(Phi).</p>
  
  <p><strong>The Complete code</strong> </p>
  
  <pre><code>% Example showing the ability of BSBL to recover non-sparse signals.
  % The signal to recover is a real-world fetal ECG data
  clear; close all;      
  N = 250;
  M = 125;
  % load fetal ECG data
  load ECGsegment.mat;
  x = double(ecg);
  % load a sparse binary matrix. 
  load Phi.mat;
  % =========================== Compress the ECG data ====================
  y = Phi * x;
  
  % First recover the signal's coefficients in the DCT domain;
  % Then recover the signal using the DCT ceofficients and the DCT basis
  % Look at the coefficients when representing the fetal ECG signal in DCT
  % domain; Still, the coefficients are not sparse. To recover all the
  % coefficients are not impossible for most compressed sensing algorithms!
  set(0, 'DefaultFigurePosition', [400 150 500 400]);
  figure(2);
  plot(dct(ecg)); title('\bf DCT coefficients of the fetal ECG signal; They are still not sparse!');
  % Now we use the BSBL-BO. Its' block size is randomly set ( = 25, as in the
  % above experiment).
  
  **A=zeros(M,N);
  for k=1:M
  A(k,:)=dct(Phi(k,:));
  end**
  Result2 = BSBL_BO(A,y,groupStartLoc,0,'prune_gamma',-1, 'max_iters',20);
  signal_hat = idct(Result2.x);
  set(0, 'DefaultFigurePosition', [800 150 500 400]);
  figure(3);
  subplot(211);plot(signal_hat); title('\bf Reconstructed by BSBL-BO from DCT Domain'); 
  subplot(212);plot(x,'r');title('\bf Original ECG Signal'); 
  </code></pre>