MATLAB Answers

Trouble with Stockwell function - basics.

4 views (last 30 days)
Hi Folks,
I'm a novice and trying to run the dost2_tutorial.m script. when a simply copy and paste the script into matlab, I get an error called: Error in StockWellTutorial (line 76)
dost2_test_signal = dost2(test_signal). I have made this in bold font below - this is my line 76
Line 76 is referenced as I have other code in the script file but it is all % out so is not active.
Can anyone help me identify why I get this error. I have copied the tutorial code directly from the MatLab web site below. It can also be found at: https://www.mathworks.com/matlabcentral/fileexchange/47223-2-dimensional-dost-zip?focused=3830320&tab=function
Much appreciated if anyone can offer some guidance.
Ricky
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% dost2_tutorial (script)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% this script shows how to apply the dost2 and the idost2 to images.
% For more informations on the dost2 and the idost2 see the comments
% on their code.
%
% Code by: U. Battisti and L. Riba
% July, 02 2014
%
% References:
% [1] R.G. Stockwell, "Why use the S-Transform", Pseudo-differential
% operators partial differential equations and time-frequency
% analysis, vol. 52 Fields Inst. Commun., pages 279--309,
% Amer. Math. Soc., Providence, RI 2007;
% [2] R.G. Stockwell, "A basis for efficient representation of the
% S-transform", Digital Signal Processing, 17: 371--393, 2007;
% [3] Y. Wang and J. Orchard, "Fast-discrete orthonormal
% Stockwell transform", SISC: 31:4000--4012, 2009;
% [4] Y. Wang, "Efficient Stockwell transform with applications to
% image processing", PhD thesis, University of Waterloo,
% Ontario Canada, 2011;
% [5] U. Battisti, L.Riba, "Window-dependent bases for efficient
% representation of the Stockwell transform", 2014
% http://arxiv.org/abs/1406.0513.
%
%
% Additional details:
% Copyright (c) by U. Battisti and L. Riba
% $Revision: 1.0 $
% $Date: 2014/07/02 $
%
%
% Summary:
% 1) read an image (we use the classical "Lena");
% 2) compute the dost coefficients of the signal;
% 3) compute the inverse dost of the dost to reconstruct the signal;
% 4) plot the signal, the dost coefficients and the reconstructed signal.
clear all
close all
% read the test-signal
test_signal = double(imread('lena.bmp'));
% compute the dost coefficients of the signal "test_signal"
dost2_test_signal = dost2(test_signal);
% reconstruct the signal using the idost2
reconstructed_test_signal = idost2(dost2_test_signal);
figure
subplot(1,3,1)
imagesc(test_signal)
title('test signal')
axis equal
axis tight
subplot(1,3,2)
%imagesc(log(abs(dost2_test_signal)))
imagesc([-.5 .5], [-.5 .5], log(abs(dost2_test_signal)))
title('(log of the norm of the) dost2 of the test signal')
axis equal
axis tight
subplot(1,3,3)
imagesc(real(reconstructed_test_signal))
title('reconstructed test signal')
axis equal
axis tight
colormap gray

  1 Comment

Riccardo Chianese
Riccardo Chianese on 17 Jun 2020
Thank you, it is now working.
I would like to create a function to apply Stockwell2D to RGB images and call this function from the batch processing app. Do you have any examples of how to creat such a function?
Many thanks
Ricky

Sign in to comment.

Accepted Answer

Samatha Aleti
Samatha Aleti on 16 Jun 2020
Hi,
I understand that you are trying to run the script by copy pasting only the “dost2_tutorial file. This file is a tutorial and uses dost2 and “idost2” functions. To run the dost2_tutorial” file, you need to have “dost2” and “idost2” functions as well.
So, I suggest you to download the MATLAB File Exchange submission “2-Dimensional DOST which includes all the necessary files for the tutorial and avoids such issues.
Hope this helps!

  0 Comments

Sign in to comment.

More Answers (0)

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!