« Earlier2 items total Later »

Windowing a framed signal

Couresty of Mario

% For framing use buffer() or your own favorite
% Frame length: 256, Number of frames: 10000
X = randn(256,10000);

% Make a window (same for each frame)
w = hamming(256);
W = diag(sparse(w));

% Look ma, no loops! This is the windowed signal.
XW = W * X;

% Make a vector of random gain factors (one per frame)
g  = rand(10000,1);
G  = diag(sparse(g))

% Now lets scale each frame by the corresponding gain factor and voila!
XG = X * G;

% Windowing and gain scaling is just left and right product with a diagonal.
XWG = W * X * G;

Change the title of the matlab window

QUO posted this on that matlab newsgroup. If you want to change the title of the Matlab main window here is a function that will do the job.

function changetitle(str)

   %first get all of the Java frames present in the current JVM
   frms = java.awt.Frame.getFrames();

   %now, let's look through those frames for one that seems like it
might be the main frame
   root = [];
   for m = 1:length(frms)
      if strcmpi(get(frms(m),'Type'), ...
             'com.mathworks.mde.desk.MLMainFrame')
           root = frms(m);
         break;
      end
   end
   if isempty(root)
      error('Could not find my main frame')
   end
   set(root,'Title',str)

« Earlier2 items total Later »




Sponsored by

Sole Central

Your one stop shop for Birkenstock and Crocs shoes and sandles.