compressive sensing and biorthogonal wavelet matrix

180 Views Asked by At

I want to use compressive sensing to reconstruct an image from fewer samples. My problem is with Psi matrix which I want to be Biorthogonal wavelet coefficients but I don't know how to define it. I have used Fourier basis and Haar wavelet and it worked well. Here is my code with Haar wavelet.

Can anyone tell me how to define Psi matrix as Biorthogonal wavelet transform? Thanks in advance.

 clc
close all
clear all

[fn,fp]=uigetfile({'*.*'});

A=im2double(rgb2gray(imread([fp,fn])));
figure(1),imshow(A)
xlabel('original')

x=A(:);
n=length(x);

m=0.3*n;
Phi=randn(m,n);   %Measurment Matrix
Psi=generate_haar(n);   %sensing Matrix which is made by generate_haar function

y=Phi*x;  %compressed signal
Theta=Phi*Psi;

%Initial Guess:  y=Theta*s => s=Theta\y

s2=Theta\y;

%Solution
s1=OMP( Theta, y, 1e-3);

%Reconstruction
x1=Psi*s1;
figure,imshow(reshape(x1,size(A))),xlabel('OMP')
1

There are 1 best solutions below

6
On

You don't have to define the matrix explicitly and in general it is a bad idea to do so. For instance, the matrix implementation of the DFT will be an order of magnitude slower than the FFT implementation. Instead, what one usually does is use a function handle. Using the DFT as an example, since the adjoint of the operator is the inverse DFT, the function would look something like

function y = fftop( x, adj )
  if( adj == 0 )
    y = fft( x );
  else
    y = ifft( x );
  end

The solver should (and all that I have ever seen do) take a function handle for the linear operator as well as an explicit matrix. (The explicit matrix is then converted into a function handle within the solver.) For instance, look at the documentation for lsqr. How it will exactly look will all depend on the software you use, but it will be something along the lines of

x = array_of_measurements;
f = @(q,adj) fftop(q,adj);
z = my_solver( x, f );

As for the wavelet transform, if the adjoint is the inverse, then construct a function similar to the above and avoid creating the matrix representation of the operator altogether.