Examples of Complex

@author Edward A. Lee, Jeff Tsay, Steve Neuendorffer, Adam Cataldo @version $Id: Complex.java,v 1.91 2007/12/06 21:57:08 cxh Exp $ @since Ptolemy II 0.2 @Pt.ProposedRating Yellow (eal) @Pt.AcceptedRating Red (cxh)
  • r.data.RComplex.Complex

  • Examples of com.talixa.specan.fft.Complex

          // fill the data array
          for (int offset = 0; offset < FFT_LEN; offset++) {
            int desiredSampleIndex = (baseAddress)+offset;         
            short signedSample = data[desiredSampleIndex];                 
            double sample = ((double) signedSample) / (Short.MAX_VALUE);
            amplitudeData[offset] = new Complex(sample,0);
          }                             

          // run fft
          frequencyData = FFT.fft(amplitudeData);
                     
          if (shift < 0) {
            // downshift
           
            // calculate new 0
            int newZero = SharedDSPFunctions.getSampleNumberByFrequency(FFT_LEN, shift*-1);
           
            // shift new zero to zero
            for(int i = 0; i < FFT_LEN/2; ++i) {
              Complex value;
              if (i + newZero < FFT_LEN/2) {
                value = frequencyData[i+newZero];
              } else {
                value = new Complex(0,0);
              }
           
              frequencyData[i] = value;
              frequencyData[FFT_LEN-i-1] = value;
           
          } else {
            // calculate where to put the old 0
            int oldZero = SharedDSPFunctions.getSampleNumberByFrequency(FFT_LEN, shift);
           
            // upshift
            for(int i = FFT_LEN/2-1; i > 0 ; --i) {
              Complex value;
              if (i - oldZero > 0) {
                value = frequencyData[i-oldZero];
              } else {
                value = new Complex(0,0);
              }
           
              frequencyData[i] = value;
              frequencyData[FFT_LEN-i-1] = value;
           
    View Full Code Here

    Examples of core.Complex

        @Override
        public Integer cardinality() { return null; }

        @Override
        public Complex getRandomElement() {
          return new Complex();
        }
    View Full Code Here

    Examples of de.ailis.xadrian.data.Complex

                final SelectGameDialog dialog = SelectGameDialog.getInstance();
                if (dialog.open() != Result.OK) return;
                game = dialog.getGame();
                if (dialog.isRemember()) config.setDefaultGame(game.getId());
            }
            createComplexTab(new ComplexEditor(new Complex(game)));
        }
    View Full Code Here

    Examples of edu.cmu.sphinx.util.Complex

             * we need only return values between 0 and 255.
             */
            computeLogBase2(numberFftPoints);
            createWeightFft(numberFftPoints, invert);
            initComplexArrays();
            weightFftTimesFrom2 = new Complex();
            tempComplex = new Complex();
        }
    View Full Code Here

    Examples of eu.admire.seismo.common.Complex

              resPAZ.setName(name.toString());
            }
            if(currentLine.startsWith("B053F10-13")){
              String[] tokens= currentLine.split("\\s+");
            
              Complex zero=new Complex(new Double(tokens[2].trim()), new Double(tokens[3].trim()));
              zeros.add(zero);         
            }
            if(currentLine.startsWith("B053F15-18")){
                  String[] tokens= currentLine.split("\\s+");
                 
              Complex pole=new Complex(new Double(tokens[2].trim()), new Double(tokens[3].trim()));
              poles.add(pole);         
            }
            if(currentLine.startsWith("B058F04")){
              String[] tokens= currentLine.split("Gain:\\s+");
             
    View Full Code Here

    Examples of flanagan.complex.Complex

                return ph2;
            }

            // Natural log of a Phasor
            public static Phasor log(Phasor ph1){
                Complex com = new Complex(Math.log(ph1.magnitude), ph1.phaseInDeg);
                Phasor ph2 = Phasor.toPhasor(com);;
                return ph2;
            }
    View Full Code Here

    Examples of jjil.core.Complex

                        null,
                        null);
            }
            this.fft.push(im);
            Complex32Image cxmIm = (Complex32Image) this.fft.getFront();
            Complex cxIn[] = cxmIm.getData();
            Complex32Image cxmResult = new Complex32Image(im.getWidth(), im.getHeight());
            Complex cxOut[] = cxmResult.getData();
            Complex cxPsfInv[] = this.cxmPsfInv.getData();
            int nPsfSq[] = this.gPsfSq.getData();
            // compute Wiener filter
            for (int i=0; i<im.getWidth() * im.getHeight(); i++) {
                int nMag = cxIn[i].magnitude();
                int nScale = (nPsfSq[i] * nMag) / ((nPsfSq[i] * nMag) + this.nNoise);
    View Full Code Here

    Examples of jscicalc.complex.Complex

         * @param x The first value (left of symbol)
         * @param y The second value (right of symbol)
         * @return The result of the operation
         */
        public OObject function( OObject x, OObject y ){
      return x.multiply( (y.multiply( (new Complex( base, 0 )).log()) ).exp() );
        }
    View Full Code Here

    Examples of jscicalc.complex.Complex

          System.out.println( "length: " + i + " precision: " + d.precision( i )  );
          System.out.println( "length: " + i + " scientific precision: "
            + d.scientificPrecision( i )  );
      }
      */
      Complex c = new Complex( 4, 5 );
      Format f = new Format( c, Base.DECIMAL );
      System.out.println( "--------------------" );
      System.out.println( f.formatStandard( Base.DECIMAL, 5, 20, true, true ) );
      c = new Complex( 0, 0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 5, 20, true, true ) );
      c = new Complex( 0, 1 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 5, 20, true, true ) );
      c = new Complex( 1, 0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 5, 20, true, true ) );
      c = new Complex( 0.002, -1 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( "--------------------" );
      System.out.println( f.formatStandard( Base.DECIMAL, 5, 20, true, true ) );
      c = new Complex( -1, 0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 5, 20, true, true ) );
      c = new Complex( -12, 0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 5, 20, true, true ) );
      c = new Complex( 123, 0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 5, 20, true, true ) );
      c = new Complex( 1234, 0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 5, 20, true, true ) );
      c = new Complex( 12345, 0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 123456, 0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 1234567, 0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 12345678, 0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 123456789, 0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 1234567891.0, 0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 12345678912.0, 0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 123456789123.0, 0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 1234567891234.0, 0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 12345678912345.0, 0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 1234.0, -4321.0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 1234.0, -4321.0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 12345.0, -54321.0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 123456.0, -654321.0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 1234567.0, -7654321.0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 12345678.0, -87654321.0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 123456789.0, -987654321.0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 234567891.0, -1987654321.0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 1234567891.0, -987654321.0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
      c = new Complex( 1234567891.0, -1987654321.0 );
      f = new Format( c, Base.DECIMAL );
      System.out.println( f.formatStandard( Base.DECIMAL, 9, 20, true, true ) );
        }
    View Full Code Here

    Examples of jscicalc.complex.Complex

         * @param x The value (right of symbol)
         * @return The result of the operation
         */
        public OObject function( OObject x ){
      if( x instanceof Complex ){
          Complex c = (Complex)x;
          if( scale != 1 && Math.abs( c.imaginary() ) > 1e-6 )
        throw new RuntimeException( "Error" );
          return c.scale( scale ).sin();
      } else {
          return x.sin( angleType );
      }
        }
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. All rights reserved.
    All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.