亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? stransform.m

?? Stockwell S變換的Matlab實現,具有FFT和小波變換的特性
?? M
字號:
 
function [st,t,f] = st(timeseries,minfreq,maxfreq,samplingrate,freqsamplingrate)
% Returns the Stockwell Transform of the timeseries.
% Code by Robert Glenn Stockwell.
% DO NOT DISTRIBUTE
% BETA TEST ONLY
% Reference is "Localization of the Complex Spectrum: The S Transform"
% from IEEE Transactions on Signal Processing, vol. 44., number 4, April 1996, pages 998-1001.
%
%-------Inputs Needed------------------------------------------------
%  
%   *****All frequencies in (cycles/(time unit))!******
%	"timeseries" - vector of data to be transformed
%-------Optional Inputs ------------------------------------------------
%
%"minfreq" is the minimum frequency in the ST result(Default=0)
%"maxfreq" is the maximum frequency in the ST result (Default=Nyquist)
%"samplingrate" is the time interval between samples (Default=1)
%"freqsamplingrate" is the frequency-sampling interval you desire in the ST result (Default=1)
%Passing a negative number will give the default ex.  [s,t,f] = st(data,-1,-1,2,2)
%-------Outputs Returned------------------------------------------------
%
% st     -a complex matrix containing the Stockwell transform. 
%			 The rows of STOutput are the frequencies and the 
%         columns are the time values ie each column is 
%         the "local spectrum" for that point in time
%  t      - a vector containing the sampled times
%  f      - a vector containing the sampled frequencies
%--------Additional details-----------------------
%   %  There are several parameters immediately below that
%  the user may change. They are:
%[verbose]    if true prints out informational messages throughout the function.
%[removeedge] if true, removes a least squares fit parabola
%                and puts a 5% hanning taper on the edges of the time series.
%                This is usually a good idea.
%[analytic_signal]  if the timeseries is real-valued
%                      this takes the analytic signal and STs it.
%                      This is almost always a good idea.
%[factor]     the width factor of the localizing gaussian
%                ie, a sinusoid of period 10 seconds has a 
%                gaussian window of width factor*10 seconds.
%                I usually use factor=1, but sometimes factor = 3
%                to get better frequency resolution.
%   Copyright (c) by Bob Stockwell
%   $Revision: 1.2 $  $Date: 1997/07/08  $


% This is the S transform wrapper that holds default values for the function.
TRUE = 1;
FALSE = 0;
%%% DEFAULT PARAMETERS  [change these for your particular application]
verbose = TRUE;          
removeedge= FALSE;
analytic_signal =  FALSE;
factor = 1;
%%% END of DEFAULT PARAMETERS


%%%START OF INPUT VARIABLE CHECK
% First:  make sure it is a valid time_series 
%         If not, return the help message

if verbose disp(' '),end  % i like a line left blank

if nargin == 0 
   if verbose disp('No parameters inputted.'),end
   st_help
   t=0;,st=-1;,f=0;
   return
end

% Change to column vector
if size(timeseries,2) > size(timeseries,1)
	timeseries=timeseries';	
end

% Make sure it is a 1-dimensional array
if size(timeseries,2) > 1
   error('Please enter a *vector* of data, not matrix')
	return
elseif (size(timeseries)==[1 1]) == 1
	error('Please enter a *vector* of data, not a scalar')
	return
end

% use defaults for input variables

if nargin == 1
   minfreq = 0;
   maxfreq = fix(length(timeseries)/2);
   samplingrate=1;
   freqsamplingrate=1;
elseif nargin==2
   maxfreq = fix(length(timeseries)/2);
   samplingrate=1;
   freqsamplingrate=1;
   [ minfreq,maxfreq,samplingrate,freqsamplingrate] =  check_input(minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,timeseries);
elseif nargin==3 
   samplingrate=1;
   freqsamplingrate=1;
   [ minfreq,maxfreq,samplingrate,freqsamplingrate] =  check_input(minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,timeseries);
elseif nargin==4   
   freqsamplingrate=1;
   [ minfreq,maxfreq,samplingrate,freqsamplingrate] =  check_input(minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,timeseries);
elseif nargin == 5
      [ minfreq,maxfreq,samplingrate,freqsamplingrate] =  check_input(minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,timeseries);
else      
   if verbose disp('Error in input arguments: using defaults'),end
   minfreq = 0;
   maxfreq = fix(length(timeseries)/2);
   samplingrate=1;
   freqsamplingrate=1;
end
if verbose 
   disp(sprintf('Minfreq = %d',minfreq))
   disp(sprintf('Maxfreq = %d',maxfreq))
   disp(sprintf('Sampling Rate (time   domain) = %d',samplingrate))
   disp(sprintf('Sampling Rate (freq.  domain) = %d',freqsamplingrate))
   disp(sprintf('The length of the timeseries is %d points',length(timeseries)))

   disp(' ')
end
%END OF INPUT VARIABLE CHECK

% If you want to "hardwire" minfreq & maxfreq & samplingrate & freqsamplingrate do it here

% calculate the sampled time and frequency values from the two sampling rates
t = (0:length(timeseries)-1)*samplingrate;
spe_nelements =ceil((maxfreq - minfreq+1)/freqsamplingrate)   ;
f = (minfreq + [0:spe_nelements-1]*freqsamplingrate)/(samplingrate*length(timeseries));
if verbose disp(sprintf('The number of frequency voices is %d',spe_nelements)),end


% The actual S Transform function is here:
st = strans(timeseries,minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,removeedge,analytic_signal,factor); 
% this function is below, thus nicely encapsulated

%WRITE switch statement on nargout
% if 0 then plot amplitude spectrum
if nargout==0 
   if verbose disp('Plotting pseudocolor image'),end
   pcolor(t,f,abs(st))
end


return


%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


function st = strans(timeseries,minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,removeedge,analytic_signal,factor); 
% Returns the Stockwell Transform, STOutput, of the time-series
% Code by R.G. Stockwell.
% Reference is "Localization of the Complex Spectrum: The S Transform"
% from IEEE Transactions on Signal Processing, vol. 44., number 4,
% April 1996, pages 998-1001.
%
%-------Inputs Returned------------------------------------------------
%         - are all taken care of in the wrapper function above
%
%-------Outputs Returned------------------------------------------------
%
%	ST    -a complex matrix containing the Stockwell transform.
%			 The rows of STOutput are the frequencies and the
%			 columns are the time values
%
%
%-----------------------------------------------------------------------

% Compute the length of the data.
n=length(timeseries);
original = timeseries;
if removeedge
    if verbose disp('Removing trend with polynomial fit'),end
 	 ind = [0:n-1]';
    r = polyfit(ind,timeseries,2);
    fit = polyval(r,ind) ;
	 timeseries = timeseries - fit;
    if verbose disp('Removing edges with 5% hanning taper'),end
    sh_len = floor(length(timeseries)/10);
    wn = hanning(sh_len);
    if(sh_len==0)
       sh_len=length(timeseries);
       wn = 1&[1:sh_len];
    end
    % make sure wn is a column vector, because timeseries is
   if size(wn,2) > size(wn,1)
      wn=wn';	
   end
   
   timeseries(1:floor(sh_len/2),1) = timeseries(1:floor(sh_len/2),1).*wn(1:floor(sh_len/2),1);
	timeseries(length(timeseries)-floor(sh_len/2):n,1) = timeseries(length(timeseries)-floor(sh_len/2):n,1).*wn(sh_len-floor(sh_len/2):sh_len,1);
  
end

% If vector is real, do the analytic signal 

if analytic_signal
   if verbose disp('Calculating analytic signal (using Hilbert transform)'),end
   % this version of the hilbert transform is different than hilbert.m
   %  This is correct!
   ts_spe = fft(real(timeseries));
   h = [1; 2*ones(fix((n-1)/2),1); ones(1-rem(n,2),1); zeros(fix((n-1)/2),1)];
   ts_spe(:) = ts_spe.*h(:);
   timeseries = ifft(ts_spe);
end  

% Compute FFT's
tic;vector_fft=fft(timeseries);tim_est=toc;
vector_fft=[vector_fft,vector_fft];
tim_est = tim_est*ceil((maxfreq - minfreq+1)/freqsamplingrate)   ;
if verbose disp(sprintf('Estimated time is %f',tim_est)),end

% Preallocate the STOutput matrix
st=zeros(ceil((maxfreq - minfreq+1)/freqsamplingrate),n);
% Compute the mean
% Compute S-transform value for 1 ... ceil(n/2+1)-1 frequency points
if verbose disp('Calculating S transform...'),end
if minfreq == 0
   st(1,:) = mean(timeseries)*(1&[1:1:n]);
else
  	st(1,:)=ifft(vector_fft(minfreq+1:minfreq+n).*g_window(n,minfreq,factor));
end

%the actual calculation of the ST
% Start loop to increment the frequency point
for banana=freqsamplingrate:freqsamplingrate:(maxfreq-minfreq)
   st(banana/freqsamplingrate+1,:)=ifft(vector_fft(minfreq+banana+1:minfreq+banana+n).*g_window(n,minfreq+banana,factor));
end   % a fruit loop!   aaaaa ha ha ha ha ha ha ha ha ha ha
% End loop to increment the frequency point
if verbose disp('Finished Calculation'),end

%%% end strans function

%------------------------------------------------------------------------
function gauss=g_window(length,freq,factor)

% Function to compute the Gaussion window for 
% function Stransform. g_window is used by function
% Stransform. Programmed by Eric Tittley
%
%-----Inputs Needed--------------------------
%
%	length-the length of the Gaussian window
%
%	freq-the frequency at which to evaluate
%		  the window.
%	factor- the window-width factor
%
%-----Outputs Returned--------------------------
%
%	gauss-The Gaussian window
%

vector(1,:)=[0:length-1];
vector(2,:)=[-length:-1];
vector=vector.^2;    
vector=vector*(-factor*2*pi^2/freq^2);
% Compute the Gaussion window
gauss=sum(exp(vector));

%-----------------------------------------------------------------------

%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^%
function [ minfreq,maxfreq,samplingrate,freqsamplingrate] =  check_input(minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,timeseries)
% this checks numbers, and replaces them with defaults if invalid

% if the parameters are passed as an array, put them into the appropriate variables
s = size(minfreq);
l = max(s);
if l > 1  
   if verbose disp('Array of inputs accepted.'),end
   temp=minfreq;
   minfreq = temp(1);;
   if l > 1  maxfreq = temp(2);,end;
   if l > 2  samplingrate = temp(3);,end;
   if l > 3  freqsamplingrate = temp(4);,end;
   if l > 4  
      if verbose disp('Ignoring extra input parameters.'),end
   end;

end      
     
   if minfreq < 0 | minfreq > fix(length(timeseries)/2);
      minfreq = 0;
      if verbose disp('Minfreq < 0 or > Nyquist. Setting minfreq = 0.'),end
   end
   if maxfreq > length(timeseries)/2  | maxfreq < 0 
      maxfreq = fix(length(timeseries)/2);
      if verbose disp(sprintf('Maxfreq < 0 or > Nyquist. Setting maxfreq = %d',maxfreq)),end
   end
      if minfreq > maxfreq 
      temporary = minfreq;
      minfreq = maxfreq;
      maxfreq = temporary;
      clear temporary;
      if verbose disp('Swapping maxfreq <=> minfreq.'),end
   end
   if samplingrate <0
      samplingrate = abs(samplingrate);
      if verbose disp('Samplingrate <0. Setting samplingrate to its absolute value.'),end
   end
   if freqsamplingrate < 0   % check 'what if freqsamplingrate > maxfreq - minfreq' case
      freqsamplingrate = abs(freqsamplingrate);
      if verbose disp('Frequency Samplingrate negative, taking absolute value'),end
   end

% bloody odd how you don't end a function

%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^%
function st_help
   disp(' ')
	disp('st()  HELP COMMAND')
	disp('st() returns  - 1 or an error message if it fails')
	disp('USAGE::    [localspectra,timevector,freqvector] = st(timeseries)')
  	disp('NOTE::   The function st() sets default parameters then calls the function strans()')
   disp(' ')  
   disp('You can call strans() directly and pass the following parameters')
   disp(' **** Warning!  These inputs are not checked if strans() is called directly!! ****')
  	disp('USAGE::  localspectra = strans(timeseries,minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,removeedge,analytic_signal,factor) ')
     
   disp(' ')
   disp('Default parameters (available in st.m)')
	disp('VERBOSE          - prints out informational messages throughout the function.')
	disp('REMOVEEDGE       - removes the edge with a 5% taper, and takes')
   disp('FACTOR           -  the width factor of the localizing gaussian')
   disp('                    ie, a sinusoid of period 10 seconds has a ')
   disp('                    gaussian window of width factor*10 seconds.')
   disp('                    I usually use factor=1, but sometimes factor = 3')
   disp('                    to get better frequency resolution.')
   disp(' ')
   disp('Default input variables')
   disp('MINFREQ           - the lowest frequency in the ST result(Default=0)')
   disp('MAXFREQ           - the highest frequency in the ST result (Default=nyquist')
   disp('SAMPLINGRATE      - the time interval between successive data points (Default = 1)')
   disp('FREQSAMPLINGRATE  - the number of frequencies between samples in the ST results')
	
% end of st_help procedure   


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品久久久久秋霞影院| 欧美乱妇一区二区三区不卡视频| 免费欧美高清视频| 亚洲一二三区视频在线观看| 有码一区二区三区| 亚洲免费在线视频| 一区av在线播放| 午夜精品福利在线| 美腿丝袜在线亚洲一区| www.成人在线| 99久久99久久免费精品蜜臀| 色婷婷综合在线| 色综合婷婷久久| 欧美日韩国产一级| 欧美一二三四区在线| 欧美v日韩v国产v| 欧美精品一区二区三区在线| 精品乱码亚洲一区二区不卡| 国产亚洲美州欧州综合国| 国产三级三级三级精品8ⅰ区| 中文字幕av一区二区三区高 | www.激情成人| 欧美三级蜜桃2在线观看| 欧美一区二区播放| 日本一区二区三区dvd视频在线| 中文字幕一区二区在线观看 | 欧美高清视频不卡网| 久久精品人人做人人爽人人| 国产精品国产三级国产| 亚洲一区二区精品视频| 久久99国产精品久久99果冻传媒| 成人在线视频一区二区| 欧美军同video69gay| 国产人伦精品一区二区| 一区二区三区四区不卡在线 | 欧美视频一区二区| 欧美精品一区二区三区很污很色的 | 一本色道久久综合亚洲aⅴ蜜桃| 欧美精品在欧美一区二区少妇| 久久久久青草大香线综合精品| 一区二区三区精品视频| 国产一区二区三区四区五区美女| 色综合久久综合网| 欧美国产日本视频| 秋霞午夜鲁丝一区二区老狼| 一本高清dvd不卡在线观看| 欧美xxxxxxxx| 丝袜美腿高跟呻吟高潮一区| 91性感美女视频| 精品国产乱码久久久久久浪潮| 一区二区理论电影在线观看| 国产激情视频一区二区三区欧美 | 天天做天天摸天天爽国产一区 | 99re成人精品视频| 日韩欧美美女一区二区三区| 一卡二卡三卡日韩欧美| 不卡一区二区三区四区| 日韩美女视频在线| 五月天网站亚洲| 91久久线看在观草草青青| 26uuuu精品一区二区| 青青草91视频| 日韩一区二区电影在线| 日韩精品1区2区3区| 欧美日韩视频第一区| 樱桃视频在线观看一区| 91片在线免费观看| 国产精品蜜臀在线观看| 成人午夜在线播放| 国产日韩三级在线| 国产成人啪免费观看软件| 久久亚洲精品国产精品紫薇| 韩国成人福利片在线播放| 日韩精品在线看片z| 久久爱www久久做| 日韩精品影音先锋| 国产高清久久久| 国产欧美一区二区精品久导航| 国产一区二区三区四区在线观看| 久久精品亚洲麻豆av一区二区 | 制服丝袜一区二区三区| 午夜精品久久久久久不卡8050| 国产在线麻豆精品观看| 久久久久久久久久久久久久久99| 国产一区视频网站| 亚洲国产精品成人久久综合一区| 福利一区福利二区| 亚洲视频网在线直播| 在线观看一区二区精品视频| 天堂va蜜桃一区二区三区漫画版| 欧美电影影音先锋| 黄一区二区三区| 国产精品国产三级国产aⅴ原创 | 爽好多水快深点欧美视频| 51精品国自产在线| 国产麻豆精品在线观看| 国产精品久久久久久久久搜平片| 色综合咪咪久久| 日韩和欧美一区二区| 中文天堂在线一区| 欧美色区777第一页| 裸体在线国模精品偷拍| 国产婷婷精品av在线| 在线观看欧美精品| 老司机精品视频在线| 中文字幕av免费专区久久| 欧美在线观看一区二区| 韩日精品视频一区| 亚洲精品成人悠悠色影视| 777午夜精品免费视频| 国产高清一区日本| 成人黄色av网站在线| 亚洲国产综合色| 久久久噜噜噜久噜久久综合| 欧美亚洲自拍偷拍| 国产成人鲁色资源国产91色综| 亚洲精品中文在线观看| 琪琪久久久久日韩精品| 国产黄人亚洲片| 26uuu亚洲综合色| 日本不卡在线视频| 欧美日产在线观看| 日韩高清不卡在线| 欧美日产国产精品| 丝袜a∨在线一区二区三区不卡| 99亚偷拍自图区亚洲| 国产三级精品三级| 成人av免费在线播放| 国产精品丝袜一区| 91麻豆国产香蕉久久精品| 玉米视频成人免费看| 精品视频资源站| 美女任你摸久久| 国产欧美日韩视频在线观看| 国产高清一区日本| 一片黄亚洲嫩模| 亚洲午夜视频在线观看| 91国偷自产一区二区三区观看| 开心九九激情九九欧美日韩精美视频电影 | 国产精品一区三区| 欧美精品一区二区三区蜜桃视频| 成人av电影免费观看| 日韩一区二区三区观看| 亚洲人成伊人成综合网小说| 精品一区在线看| 亚洲v中文字幕| 亚洲精品免费电影| 1区2区3区精品视频| 国产精品久久久久久亚洲伦| 国产亚洲精品bt天堂精选| 欧美日韩五月天| 欧美丝袜丝交足nylons| 91电影在线观看| 91久久精品午夜一区二区| 欧美日韩情趣电影| 欧美日韩专区在线| 欧美日韩精品一区二区三区蜜桃| 欧美日韩中字一区| 欧美一区二区性放荡片| 日韩午夜激情av| 26uuu亚洲婷婷狠狠天堂| 久久伊99综合婷婷久久伊| 精品国产区一区| 久久久国产一区二区三区四区小说 | 亚洲欧洲日产国产综合网| 国产精品欧美精品| 亚洲区小说区图片区qvod| 亚洲国产wwwccc36天堂| 日韩在线卡一卡二| 精久久久久久久久久久| 国产一区二区三区免费看| 成人午夜视频在线| 欧美性感一类影片在线播放| 欧美日韩综合在线免费观看| 日韩一区二区不卡| 久久精品亚洲精品国产欧美kt∨| 欧美国产精品一区二区三区| 一区二区三区日韩精品| 日本三级亚洲精品| 国产iv一区二区三区| 色94色欧美sute亚洲线路一久 | 久久久久久日产精品| 中文字幕在线一区| 亚洲国产一区二区三区| 免费观看30秒视频久久| 成人福利视频网站| 欧美肥妇毛茸茸| 国产日产精品一区| 婷婷综合另类小说色区| 国产精品系列在线观看| 欧美日韩国产一区二区三区地区| 久久综合网色—综合色88| 一区二区三区精品久久久| 国产综合成人久久大片91| 色悠悠亚洲一区二区| 久久综合久色欧美综合狠狠| 亚洲精品国产第一综合99久久 | 国产欧美日韩在线| 五月天视频一区| 91女神在线视频|