MATLAB代做-python代做-FPGA代做-基于广义S变换的图像去噪分型处理方法

时间：2019-7-15 13:30:41 点击：

核心提示：MATLAB代做-python代做-FPGA代做-基于广义S变换的图像去噪分型处理方法 ...
function [st,t,f] = st(timeseries,minfreq,maxfreq,samplingrate,freqsamplingrate)
TRUE = 1;FALSE = 0;verbose = TRUE;
power = FALSE;           amplitude = FALSE;
removeedge= TRUE;analytic_signal =  TRUE;factor = 1;
if verbose disp(' =============================================='),end  % i like a line left blank
if nargin == 0
if verbose disp('No parameters inputted.'),end
t=0;,st=-1;,f=0;
return
end
if nargin == 1
minfreq = 0;
maxfreq =150;
%   maxfreq = fix(length(timeseries)/2);
samplingrate=0.001;
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
t = (0:length(timeseries)-1)*samplingrate;
spe_nelements =ceil((maxfreq - minfreq+1)/freqsamplingrate);
f = (minfreq + [0:spe_nelements-1]*freqsamplingrate)/(samplingrate*length(timeseries));

disp(sprintf('t = (0:length(timeseries)-1)*samplingrate = %d',(length(timeseries)-1)*samplingrate));
disp(sprintf('spe_nelements == %d',spe_nelements));
disp(sprintf('f == %d',(minfreq+(spe_nelements-1)*freqsamplingrate)/(samplingrate*length(timeseries))));
if verbose
disp(sprintf('The number of frequency voices is %d',spe_nelements)),
end
fid2=fopen('F:\ZYL_data\S_Tranf\original_0.txt','w');
fprintf(fid2,'%f\n',timeseries);
% 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                        %
%                                                                         %
%//////////////////////////////////////////////////////////////////////////
function st = strans(timeseries,minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,removeedge,analytic_signal,factor);
% Compute the length of the data.
n=length(timeseries);
original = timeseries;
% % Compute FFT's
vector_fft=fft(timeseries);
vector_fft=[vector_fft,vector_fft];
%--------------------------------------------------------------------------
fid3=fopen('F:\ZYL_data\S_Tranf\vector_fft_3.txt','w');
fprintf(fid3,'%f\n',vector_fft);
%--------------------------------------------------------------------------
st=zeros(ceil((maxfreq - minfreq+1)/freqsamplingrate),n);%---数组清零
aaa=zeros(ceil((maxfreq - minfreq+1)/freqsamplingrate));
%-----the actual calculation of the ST------Start loop to increment the frequency point
fid4=fopen('F:\ZYL_data\S_Tranf\fft(timeseries)_2.txt','w');
fprintf(fid4,'%f\n',fft(timeseries));
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));
%     disp(sprintf('minfreq+banana+1 == %d   minfreq+banana+n ==%d',minfreq+banana+1,minfreq+banana+n))
fid5=fopen('F:\ZYL_data\S_Tranf\ifft(vector_fft_g_window).txt','ab+');
fprintf(fid5,'%f\n',ifft(vector_fft(minfreq+banana+1:minfreq+banana+n).*g_window(n,minfreq+banana,factor)));
fid6=fopen('F:\ZYL_data\S_Tranf\g_window.txt','ab+');
fprintf(fid6,'%f\n',g_window(n,minfreq+banana,factor));
fid7=fopen('F:\ZYL_data\S_Tranf\real(vector_fft_g_window).txt','ab+');
fprintf(fid7,'%f\n',real(vector_fft(minfreq+banana+1:minfreq+banana+n).*g_window(n,minfreq+banana,factor)));
fid8=fopen('F:\ZYL_data\S_Tranf\st.txt','ab+');
fprintf(fid8,'%f\n',st(banana/freqsamplingrate+1,:));
end
% fid=fopen('F:\ZYL_data\S_Tranf\st000.txt','w');
% for banana=freqsamplingrate:freqsamplingrate:(maxfreq-minfreq)
%     for ii=1:n
%         aaa(banana/freqsamplingrate+1)=aaa(banana/freqsamplingrate+1)+st(banana/freqsamplingrate+1,ii);
%     end
%     fprintf(fid,'%f\n',aaa(banana/freqsamplingrate+1));
%     disp(sprintf('banana == %d\n',banana/freqsamplingrate+1))
% end
disp(sprintf('banana = %d',banana))
disp(sprintf('length = n = %d',n))
disp(sprintf('minfreq+banana = %d',minfreq+banana))
disp(sprintf('minfreq+banana+1 = %d',minfreq+banana+1))
disp(sprintf('minfreq+banana+n = %d',minfreq+banana+n))
disp(sprintf('factor = %d',factor))
if verbose disp('Finished Calculation'),end
%------------------------------------------------------------------------end strans function
function gauss=g_window(length,freq,factor)
%-----Inputs Needed--------------------------
% length-the length of the Gaussian window
% freq-the frequency at which to evaluate
%   the window.
% factor- the window-width factor
vector(1,:)=[0:length-1];
vector(2,:)=[-length:-1];%两行length列矩阵
vector=vector.^2;
vector=vector*(-factor*2*pi^2/freq^2);
% Compute the Gaussion window
gauss=sum(exp(vector));%每一列相加。
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^%

QQ ：1224848052

• 百度搜索
• 查阅资料过程中
• 论坛发现
• 百度贴吧发现
• 朋友介绍
• 没有相关文章
• 大名：
• 内容：