Skip to content

Commit 052ec4f

Browse files
authored
Merge pull request #256 from emclaren/fix-getcentroid
fix getCentroid reference page alignment
2 parents df60b72 + 9555aeb commit 052ec4f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/fft.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ define(function(require) {
401401
*
402402
*
403403
*function setup(){
404-
* cnv = createCanvas(800,400);
404+
* cnv = createCanvas(100,100);
405405
* sound = new p5.AudioIn();
406406
* sound.start();
407407
* fft = new p5.FFT();
@@ -421,7 +421,6 @@ define(function(require) {
421421
* fill(0,255,0); // spectrum is green
422422
*
423423
* //draw the spectrum
424-
*
425424
* for (var i = 0; i< spectrum.length; i++){
426425
* var x = map(log(i), 0, log(spectrum.length), 0, width);
427426
* var h = map(spectrum[i], 0, 255, 0, height);
@@ -445,8 +444,8 @@ define(function(require) {
445444
* rect(centroidplot, 0, width / spectrum.length, height)
446445
* noStroke();
447446
* fill(255,255,255); // text is white
448-
* textSize(40);
449-
* text("centroid: "+round(spectralCentroid)+" Hz", 10, 40);
447+
* text("centroid: ", 10, 20);
448+
* text(round(spectralCentroid)+" Hz", 10, 40);
450449
*}
451450
* </code></div>
452451
*/

0 commit comments

Comments
 (0)