Permalink
Browse files

about to move toward freq based neuron construction

  • Loading branch information...
1 parent 5f6f6b4 commit a4746b4d47a6cb7b0d95bf7acf198d8c7822763b @zk committed Jan 15, 2009
View
14 src/main/java/napplelabs/dbssim/NeuronSignal.java
@@ -24,7 +24,7 @@
* ns.generate(first_chunk); // gets first chunk
* ns.generate(second_chunk); // gets second chunk
*
- * //Send first and second chunk to output
+ * //Then send first and second chunk to output
* @author zkim
*
*/
@@ -40,12 +40,16 @@ public NeuronSignal(float[] spike) {
public void generate(float[] signal) {
for(int i=0; i < signal.length; i++) {
- signal[i] = spike[counter];
-
- counter++;
- if(counter >= spike.length) counter = 0;
+ signal[i] = getNextValue();
}
}
+
+ public float getNextValue() {
+ float next = spike[counter];
+ counter++;
+ if(counter >= spike.length) counter = 0;
+ return next;
+ }
public void generate(float[] left, float[] right) {
View
2 src/main/java/napplelabs/dbssim/example/ExampleNeuronSignal.java
@@ -20,8 +20,6 @@ public static void main(String[] args) {
Minim minim = new Minim(null);
out = minim.getLineOut(Minim.MONO);
- //pink = new PinkNoise(0.2f);
-
double one = (float) (Math.PI / 100);
int sin_size = 1000;
View
BIN target/classes/napplelabs/dbssim/NeuronSignal.class
Binary file not shown.
View
BIN target/classes/napplelabs/dbssim/example/ExampleNeuronSignal.class
Binary file not shown.

0 comments on commit a4746b4

Please sign in to comment.