MATLAB Wigner Pursuit Atomic Graph

Using MATLAB, I use Matching Pursuit to approximate the signal. My problem is that I'm struggling to imagine a temporary representation of the selected atoms. I am trying to create a Wigner graph similar to the following image ( source ).

enter image description here

I looked at the Wavelet Toolbox, Toolbox Toolbox, and the open-source Time-Frequency toolbar, but I might just use the wrong parameters, as my signal processing experience is quite limited.

Example

Using this data , my goal is to reproduce the plot from above.

% fit the signal using MP itermax = 50; signal = load('signal.txt'); dict = wmpdictionary(length(signal)); [signal_fit, r, coeff, iopt, qual, X] = wmpalg('OMP', signal, dict, ... 'itermax', itermax); % wigner plot of the simulated signal tfrwv(signal_fit) % wigner-ville function from time-frequency toolbox % wigner plot of each atom atoms = full(dict(:, iopt)) % selected atoms for i = 1:itermax tfrwv(atoms(:, i)) end 

Unfortunately, none of the obtained graphs approaches the target visualization. Please note that in the example I use tfrwv with standard parameters, which I configure using the graphical interface that it opens.

I am very grateful for your help.

Update

I think, now I realized that you need to use the Gabor atoms to get drops with figures resembling stretched Gaussians. Unfortunately, there are no Gabor features in the predefined dicts Toolbox Toolbox. However, this question helped me in implementing the necessary dictionaries, so I get atoms that look very similar to an example:

tf representation of selected atoms

As my plots approach, but are not perfect, two more questions open:

  • Can all the drops that we see in the first example be modeled by Gabor atoms alone or do I need another dictionary of functions?
  • How to combine separate imagesc images into one visualization?
+6
source share
2 answers

To answer your second question, "How to combine individual imagesc images into one visualization?"

If you have several 2d matrices that you want to overlay and display using imagesc , I would suggest taking the maximum element.

For example, I generate two 31x31 grids with Gaussians with different mean and variance.

 function F = generate2dGauss(mu, Sigma) x1 = -3:.2:3; x2 = -3:.2:3; [X1,X2] = meshgrid(x1,x2); F = mvnpdf([X1(:) X2(:)],mu,Sigma); F = reshape(F,length(x2),length(x1)); end F1 = generate2dGauss([1 1], [.25 .3; .3 1]); F2 = generate2dGauss([-1 -1], [.1 .1; .1 1]); 

I can build them with subtitles, as in your example,

 figure; subplot(1,2,1); title('Atom 1'); imagesc(F1); subplot(1,2,2); title('Atom 2'); imagesc(F2); 

Two subheadings with a Gaussian distribution in each

Or I can build a maximum of each element for two grids.

 figure; title('Both Atoms'); imagesc(max(F1, F2)); 

The maximum maximum for two Gaussian distributions

You can also experiment with elementary means, amounts, etc., but, based on the example you give, I think that the maximum will give you the cleanest result.

Possible pros and cons of various functions:

  • The maximum will work best if your atoms always have zero background and no negative values. If the background is null-valued, but the atoms also contain negative values, negative values ​​can be covered by the background of other atoms. If your atom overlaps, the higher the higher the value will dominate.
  • An average value will make your peaks less high, but can be more intuitive if you overlap atoms.
  • Amount will make overlapping areas more valuable.
  • If you have non-zero backgrounds, you can also try using logical indexing. You will need to make some decisions about what to do in overlapping areas, but this will make it easier to filter the background.
+3
source

Q. How to combine separate imagesc images into one visualization?

a. Use subplot to draw multiple graphs, find below a pattern with 2 to 2 graphs in the figure. Change your equations in code

 x = linspace(-5,5); y1 = sin(x); subplot(2,2,1) plot(x,y1) title('First subplot') y2 = sin(2*x); subplot(2,2,2) plot(x,y2) title('Second subplot') y3 = sin(4*x); subplot(2,2,3) plot(x,y3) title('Third subplot') y4 = sin(6*x); subplot(2,2,4) plot(x,y4) title('Fourth subplot') 
-2
source

Source: https://habr.com/ru/post/1015479/


All Articles