您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 企业财务 > Field-II---FOCUS
FieldIItoFOCUSGuideMichiganStateUniversityNovember18,20131Contents•Introduction•FieldIIContinuousWaveScript•TranslatingFieldIItoFOCUS•FOCUSContinuousWaveScript•DescriptionofMATLABProcedures2IntroductionisguideisintendedtoassistauserwhohasexperiencewritingcodewithFieldIIandwantstobeginwritingcodewithFOCUS.IfyouareonlylookingatthisguidetogetalookatFOCUScode,skiptopage10.eguideissplitintofourmainsections.efirstsectionwalksthroughwritingatypicalscriptthatcalculatescontinuous-wavepressureusingFieldII.esecondsectionbreaksthescriptapartandshowshowtheFieldIIcodewouldbewrittenusingFOCUS.ethirdsectionthenputsthiscodebacktogetherandwalksthroughadetailedscriptthatcalculatescontinuous-wavepressureusingFOCUS.elastsectionpresentsbasicfunctionsthatareusedinFOCUSandwillhelpyoutobeginwritingyourowncodeinFOCUS.MoreinformationonthefunctionsthatareusedbyFOCUScanbefoundintheFOCUSFunctionList.3FieldIIContinuousWaveScriptLet'sbeginbywalkingthroughascriptthatcalculatesthepressurefieldgeneratedbyasmallplanararrayofrectangulartransducersundercontinuouswaveexcitationinFieldII.%FieldIICWExample%StartFieldIIandsetinitialparametersfield_init(0);f0=1e6;Fs=100e6;c=1500;%Speedofsound[m/s]lambda=1500/f0;focus=[0025*lambda];%Fixedfocalpoint[m]N_elements=20;%Numberofphysicalelementswidth=7e-4;%Widthofelementheight=3e-3;%Heightofelement[m]kerf=5e-4;%Kerf[m]elefocus=1;%WhethertouseelevationfocusRfocus=25e-3;%Elevationfocus[m]%DefinethetransducerTh=xdc_linear_array(N_elements,width,height,kerf,20,1,focus);figure(1);show_xdc(Th);%Thissetsupourtrasducerarraywith200.7mmx3mmelements%spaced0.5mmedge-to-edge.Nowweneedtodefinethesimulation%gridforfieldcalculations.y=0forXZplane.spacing=width+kerf;elements_x=20;xmin=-(width+spacing)*(elements_x/2+1);xmax=(width+spacing)*(elements_x/2+1);ymin=0;ymax=0;zmin=1e-3;zmax=50*lambda;xpoints=400;ypoints=1;zpoints=300;dx=(xmax-xmin)/xpoints;dy=(ymax-ymin)/ypoints;dz=(zmax-zmin)/zpoints;x=xmin:dx:xmax;y=ymin:dy:ymax;z=zmin:dz:zmax;%Thissetsupourcoordinategridtocoverthefullwidthofthe4%transducerarrayinthexdirectionandtomeasurethepressurefieldto%50wavelengthsinthezdirection.Nowweneedtosetthesampling%frequency,themediumsoundspeedandtheexcitationsignalofthe%apertures.set_sampling(Fs);set_field('c',c);Ts=1/Fs;%SamplingperiodT=50e-6;te=0:Ts:T;%Timevectorexcitation=sin(2*pi*f0*te+pi);%Excitationsignalxdc_excitation(Th,excitation);%Thenextstepistoinitializethevectors,runthecalc_hpfunction%anddisplaytheresultingpressurefield.tic;point=[000];t1=zeros(length(x),length(z));%StarttimeforThrture1pressuresignalP1n=t1;%NormofpressurefromThrture1forn2=1:length(x)clc;[n2length(x)]forn3=1:length(z)point(1)=x(n2);point(2)=0;point(3)=z(n3);[p1,t1(n2,n3)]=calc_hp(Th,point);P1n(n2,n3)=norm(p1);endendfield_end;figure(2);h=pcolor(x*100,z*100,rot90(squeeze(abs(P1n)),3));set(h,'edgecolor','none');title('PressureFieldaty=0cm');xlabel('x(cm)');ylabel('z(cm)');ylim([0zmax*100])toc;5Figure1:etransducerarrayusedinthissimulation.6Figure2:isexampletakesabout289secondstorunona2.60GHzAMDPhenom9950Quad-CoreProcessor.7TranslatingFieldIItoFOCUSSetupaTransducerFieldIIebasicprocedureforsettingupatransducerinFieldIIistosettheinitialparametersandthendefinethetransducerbycallingafunctiontocreatetransducersandarrays.Weusedthefollowingcodeintheexampleabove:%SettingupatransducerinFieldII%Initialparametersfocus=[0025*lambda];%Fixedfocalpoint[m]N_elements=20;%Numberofphysicalelementswidth=7e-4;%Widthofelementheight=3e-3;%Heightofelement[m]kerf=5e-4;%Kerf[m]elefocus=1;%WhethertouseelevationfocusRfocus=25e-3;%Elevationfocus[m]%DefinethetransducerTh=xdc_linear_array(N_elements,width,height,kerf,20,1,focus);show_xdc(Th);FOCUSesamebasicprocedureisusedinFOCUS.%SettingupatransducerinFOCUS%Initialparametershw=3.5e-4;%Halfwidthoftheelementhh=1.5e-3;%Halfheightoftheelementelements_x=20;%Numberofelementsinthexdirectionelements_y=1;%Numberofelementsintheydirectionkerf=5e-4;%Kerf[m]spacing=2*hw+kerf;%Centertocenterspacing%Definethetransducertransducer_array=create_rect_planar(elements_x,elements_y,hw,hh,...spacing,spacing);draw_array(transducer_array);%Visualizeina3-DspaceSetGeneralParametersFieldIIInFieldII,severalparametersneedtobesetusingtheset_fieldcommandsuchasthespeedofsound.FieldIIalsorequiresthatyousettheexcitationsignaloftheaperatures.8FOCUSInFOCUS,tosetthemediumyousimplyneedtocallthedefine_mediafunction.Moreinforma-tionaboutdefine_mediacanbefoundintheFOCUSFunctionList.UnlikeFieldII,FOCUSdoesnotrequireyoutosettheexcitationofthetransducerarraywhencalculatingthecontinuous-wavepressure.CreateaCoordinateGridFieldIINextweneedtodefineasimulationgridforFieldIIcalculation.isgridisthenusedinthecom-putationcommands.FOCUSInFOCUSafunctioncalledset_coordinate_grid()canbeusedtocreateacoordinategriddatastructureusedbyFOCUSforvariouscalculations.MoreinformationonthisfunctioncanbefoundintheFOCUSFunctionList.ComputationCommandsFieldIIefollowingcodewouldbeusedinFieldIItofindthepressureofacontinuouswaveusingthecalc_hpfunction.%FindthepressurefieldinFieldII.point=[000];t1=zeros(length(x),leng
本文标题:Field-II---FOCUS
链接地址:https://www.777doc.com/doc-5509470 .html