Generate Sparsity basis matrix

3 次查看(过去 30 天)
karem adam
karem adam 2019-1-7
In this demo :
function [xx, Psi, al] = GenSyn(n,k,nist,mode,Psi)
The Mandatory arguments are :
% n = signal dimensionality
% k = sparsity level % nist = amount of generated instances
and the Outputs are :
% xx = matrix containing the generated instances
% Psi = corresponding sparsity basis
% al = matrix containing the sparse representation of xx
% Written by Mauro Mangia and Riccardo Rovatti.
clc;
clear ;
close all;
cdir = pwd;
if strcmp(cdir(end-3:end),'demo')
cd ..
addpath(genpath(pwd))
cd demo
end
GetSNRdB = @(Data, DataX) 20*log10(norm(Data)/norm(Data-DataX));
opts = spgSetParms('verbosity',0); % Turn off the SPGL1 log output
verbosity=2; %Turn on the BRak log output
%% setting
n=384;
k=5;
mode='LP'; %(LP for low-pass profile and BP for band-pass profile)
%% correlation matrix and dataset for the considered setting
% input signals
nw=3; %amount of signal instances used as dataset
[sig, F]=GenSyn(n,k,nw,mode);
%% TESTs
RND = zeros(size(sig));
for is = 1:nw
x=sig(:,is);
%% standard CS-Antipodal
% sensing matrix
phi = ceil(rand(M,n)-1+p);
%measurement vector
y=phi*x;
%signal reconstruction
RND(:,is) = F*spgl1(phi*F, y,0,1e-5,[],opts);
end
I already have a sparse signal, I do not need to generate one. What I need is just to know how to find the matrix psi, which is the corresponding sparsity basis, using Matlab?

回答(0 个)

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by