import java.awt.Dimension; import java.awt.Image; final public class MultiPathConvolution101 extends MultipathDemoSignals{ public MultiPathConvolution101(Dimension dim, Image img, String problemName){ super(dim,img,problemName); //initChildClass(problemName); } protected void initPreconstructor_Variables(){ initPreconstructorInMPLevel(); modelDescription[0]="Program 10. Model: MultiPath Indoor Dispersion for signal 101."; functionCOUNT=4; functionTitle[2]="101Input"; functionTitle[3]="101Response"; } protected void spawnParametersAfterUserApplied(){ super.spawnParametersAfterUserApplied(); convolve(input101,response101, true); } protected double functionSwitchX(int fIx, double t) {return 0;} protected double functionSwitch(int fIx, double x){ switch(fIx){ case 0: return hh(x); case 1: return drawSignal(x,beta)/scaled_chip_length; case 2: return drawSignal(x,input101); case 3: return drawSignal(x,response101); } return 0; } //----------------------------------------------- // User Input Prompts //- - - - - - - - - - - - - - - - - - - - - - - - protected int setParsToStrings(){ int i=0; String decription=""; for(int j=0; j<subModelTitle.length; j++){ decription += ", "+j+" - " + subModelTitle[j]; } strParsCrr[i][0]=String.valueOf(subModel); strParsCrr[i][1]="Sub Model: "+decription; strParsCrr[i++][2]="int"; strParsCrr[i][0]=String.valueOf(shotNoisePresented); strParsCrr[i][1]="shotNoisePresented, 0 or 1"; strParsCrr[i++][2]="int"; strParsCrr[i][0]=String.valueOf(SNR); strParsCrr[i][1]="SNR, dB"; strParsCrr[i++][2]="double"; strParsCrr[i][0]=String.valueOf(amSAR); strParsCrr[i][1]="SAR, Signal to Ambient Light Ratio"; strParsCrr[i++][2]="double"; strParsCrr[i][0]=String.valueOf(amInterferencePeriodTi); strParsCrr[i][1]="Ti, Ambient Light Interference Period, sec"; strParsCrr[i++][2]="double"; strParsCrr[i][0]=String.valueOf(amInteferenceSummationPoints); strParsCrr[i][1]="NTi, Ambient Light Interf. Sum. Points Numb., 1 for no Interference."; strParsCrr[i++][2]="int"; strParsCrr[i][0]=String.valueOf(dmnRangeX); strParsCrr[i][1]="Argument Range"; strParsCrr[i++][2]="double"; strParsCrr[i][0]=String.valueOf(dmnRangeF); strParsCrr[i][1]="Function Range"; strParsCrr[i++][2]="double"; strParsCrr[i][0]=String.valueOf(dmnStartF); strParsCrr[i][1]="Function Start"; strParsCrr[i++][2]="double"; strParsCrr[i][0]=String.valueOf(Rb); strParsCrr[i][1]="Bit Rate, Rb"; strParsCrr[i++][2]="double"; strParsCrr[i][0]=String.valueOf(ceilingHeight); strParsCrr[i][1]="Room Height, meters"; strParsCrr[i++][2]="double"; strParsCrr[i][0]=String.valueOf(L); strParsCrr[i][1]="Maximum symbol length, L"; strParsCrr[i++][2]="int"; strParsCrr[i][0]=String.valueOf(Amax); strParsCrr[i][1]="Non-zero levels in chip amplitude, A"; strParsCrr[i++][2]="int"; return i; } public String setParsFromStrings(){ int i=0; try{ subModel =Integer.parseInt(strParsCrr[i][0]); i++; shotNoisePresented =Integer.parseInt(strParsCrr[i][0]); i++; SNR =Double.parseDouble(strParsCrr[i][0]); i++; amSAR =Double.parseDouble(strParsCrr[i][0]); i++; amInterferencePeriodTi = Double.parseDouble(strParsCrr[i][0]); i++; amInteferenceSummationPoints = Integer.parseInt(strParsCrr[i][0]); i++; dmnRangeX =Double.parseDouble(strParsCrr[i][0]); i++; dmnRangeF =Double.parseDouble(strParsCrr[i][0]); i++; dmnStartF =Double.parseDouble(strParsCrr[i][0]); i++; Rb =Double.parseDouble(strParsCrr[i][0]); i++; ceilingHeight =Double.parseDouble(strParsCrr[i][0]); i++; L =Integer.parseInt(strParsCrr[i][0]); i++; Amax =Integer.parseInt(strParsCrr[i][0]); i++; }catch(Exception e){ return "Exception when (re)setting parameters.\n" + e; } return ""; } //- - - - - - - - - - - - - - - - - - - - - - - - // User Input Prompts //================================================================ } Copyright (C) 2009 Konstantin Kirillov