⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 examp_gabmul.m

📁 linear time-frequency toolbox
💻 M
字号:
%EXAMP_GABMUL  Time-frequency localization by a Gabor multiplier%%   This script creates several different time-frequency symbols%   and demonstrate their effect on a random, real input signal.%%%%     This figure shows the random signal.disp('Type "help examp_gabmul" to see a description of how this example works.');% Setup some suitable parameters for the Gabor systemL=480;a=20;M=24;b=L/M;N=L/a;% Create a tight window, so it can be used for both analysis and% synthesis.g=cantight(a,M,L);% Create the random signal.f=randn(L,1);% ------- sharp cutoff operator ---------% This cuts out a circle in the TF-plane. symbol1=zeros(M,N);for m=0:M-1  for n=0:N-1    if (m-M/2)^2+(n-N/2)^2 <(M/4)^2      symbol1(m+1,n+1)=1;    end;  end;end;% The symbol as defined by the above loops is centered such% that it keeps the high frequencys. To obtain the low ones, we% move the symbol along the first dimension:symbol1=fftshift(symbol1,1);% Do the actual filteringff1=gabmul(f,symbol1,g,a);figure(1);subplot(3,1,1);mesh(symbol1);if isoctave  subplot(3,1,2);  plot(real(ff1),';;');    subplot(3,1,3);  plot(f,';;');else  subplot(3,1,2);  plot(real(ff1));    subplot(3,1,3);  plot(f);end;% ---- Tensor product symbol, keep low frequencies.t1=pgauss(M);t2=pgauss(N);symbol2=fftshift(t1*t2',2);% Do the actual filteringff2=gabmul(f,symbol2,g,a);figure(2);subplot(3,1,1);mesh(symbol2);if isoctave  subplot(3,1,2);  plot(real(ff2),';;');    subplot(3,1,3);  plot(f,';;');else  subplot(3,1,2);  plot(real(ff2));    subplot(3,1,3);  plot(f);end;% ----- Tensor product symbol, keeps middle frequencies.t1=circshift(pgauss(M,.5),round(M/4))+circshift(pgauss(M,.5),round(3*M/4));t2=pgauss(N);symbol3=fftshift(t1*t2',2);% Do the actual filteringff3=gabmul(f,symbol3,g,a);figure(3);subplot(3,1,1);mesh(symbol3);if isoctave  subplot(3,1,2);  plot(real(ff3),';;');    subplot(3,1,3);  plot(f,';;');else  subplot(3,1,2);  plot(real(ff1));    subplot(3,1,3);  plot(f);end;% ---- Tensor product symbol, keep low frequencies.t1=pgauss(M);t2=pgauss(N);symbol2=fftshift(t1*t2',2);% Do the actual filteringff2=gabmul(f,symbol2,g,a);figure(2);subplot(3,1,1);mesh(symbol2);if isoctave  subplot(3,1,2);  plot(real(ff2),';;');    subplot(3,1,3);  plot(f,';;');else  subplot(3,1,2);  plot(real(ff2));    subplot(3,1,3);  plot(f);end;% ----- Tensor product symbol, keeps middle frequencies.t1=circshift(pgauss(M,.5),round(M/4))+circshift(pgauss(M,.5),round(3*M/4));t2=pgauss(N);symbol3=fftshift(t1*t2',2);% Do the actual filteringff3=gabmul(f,symbol3,g,a);figure(3);subplot(3,1,1);mesh(symbol3);if isoctave  subplot(3,1,2);  plot(real(ff3),';;');    subplot(3,1,3);  plot(f,';;');else  subplot(3,1,2);  plot(real(ff3));    subplot(3,1,3);  plot(f);end;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -