Android Open Source - APSK A P S K






From Project

Back to project page APSK.

License

The source code is released under:

GNU General Public License

If you think the Android project APSK listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package net.thinkindifferent.apsk;
/*from   w ww.j av a2s.c  o  m*/
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.widget.TextView;

import org.wa5znu.znuradio.dsp.Complex;
import org.wa5znu.znuradio.receiver.Controller;
import org.wa5znu.znuradio.receiver.Receiver;

public class APSK extends Activity implements Controller {
  private static final String TAG = "APSK";
  private Handler handler;
  private Receiver receiver;
  private double frequency = 1500.0;
  
  /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
    
    @Override
    public void onStart() {
      super.onStart();
    }
    
    @Override
    public void onPause() {
      Waterfall waterfall = (Waterfall)findViewById(R.id.waterfall);
      waterfall.stopThread();
      super.onPause();
    }
    
    @Override
    public void onResume() {
      super.onResume();
      handler = new Handler();
    receiver = new Receiver(this);
      if(!receiver.startReceiver())
        Log.e(TAG, "startReceiver() failed!");
      receiver.addDemodulator(this, this);
      receiver.setFrequency(frequency);
    }
    
    @Override
    public void onDestroy() {
      super.onDestroy();
    }

  @Override
  public void setFrequency(double f) {
    setFrequency(f, false);
  }

  @Override
  public void setFrequency(double f, boolean userClick) {
    receiver.setFrequency(f);
  }

  @Override
  public void setSampleRate(int f) {
  }

  @Override
  public void showNextStage() {
    receiver.showNextStage();
  }

  @Override
  public void handleStage(int frame, double[] data, int length) {
  }

  @Override
  public void handleStage(int frame, Complex[] data, int length) {
  }

  @Override
  public void handlePhase(int frame, double phi, boolean dcd) {
  }

  @Override
  public void handleText(int frame, final String s) {
    handler.post(new Runnable() {
      @Override
      public void run() {
        updateTextView(s);
      }
    });
  }
  
  private void updateTextView(String s) {
    TextView in = (TextView)this.findViewById(R.id.in);
    if(in != null)
      in.append(s);
  }

  @Override
  public void handleSpectrum(int frame, double[] data, int length) {
    Waterfall waterfall = (Waterfall)findViewById(R.id.waterfall);
    if(waterfall != null)
      waterfall.handleSpectrum(data, length);
  }
}




Java Source Code List

net.thinkindifferent.apsk.APSK.java
net.thinkindifferent.apsk.AudioInputThread.java
net.thinkindifferent.apsk.Waterfall.java
org.wa5znu.znuradio.dsp.BaseFIRFilter.java
org.wa5znu.znuradio.dsp.Complex.java
org.wa5znu.znuradio.dsp.FFT.java
org.wa5znu.znuradio.dsp.FilterDesign.java
org.wa5znu.znuradio.dsp.IQFIRFilter.java
org.wa5znu.znuradio.dsp.LowPassFilterDesign.java
org.wa5znu.znuradio.dsp.Mixer.java
org.wa5znu.znuradio.dsp.RealFIRFilter.java
org.wa5znu.znuradio.dsp.Subsampler.java
org.wa5znu.znuradio.dsp.UnitPhasor.java
org.wa5znu.znuradio.dsp.Window.java
org.wa5znu.znuradio.modems.bpsk.BPSKDemodulator.java
org.wa5znu.znuradio.modems.bpsk.PSKVaricode.java
org.wa5znu.znuradio.receiver.Controller.java
org.wa5znu.znuradio.receiver.Demodulator.java
org.wa5znu.znuradio.receiver.FrequencyHandler.java
org.wa5znu.znuradio.receiver.ModemThread.java
org.wa5znu.znuradio.receiver.PhaseHandler.java
org.wa5znu.znuradio.receiver.ReceiverHandler.java
org.wa5znu.znuradio.receiver.Receiver.java
org.wa5znu.znuradio.receiver.SpectrumHandler.java
org.wa5znu.znuradio.receiver.SpectrumThread.java
org.wa5znu.znuradio.receiver.StageHandler.java
org.wa5znu.znuradio.receiver.TextHandler.java
org.wa5znu.znuradio.receiver.WaveHandler.java