Skip to content

Commit

Permalink
replace .min
Browse files Browse the repository at this point in the history
  • Loading branch information
Hideto Manjo committed Aug 6, 2017
1 parent 3c577a8 commit 3e98e94
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions jquery.fft.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
* Released under the MIT license
*/
(function(a,b){if(typeof define==="function"&&define.amd){define(b);
}else{if(typeof exports==="object"){module.exports=b();}else{a.FFT=b();}}}(this,function(){var c=function(k){this.settings=k||{samplingrate:1};};c.prototype={dim:function f(l,k){var m=l.length;
while(true){if(!(m&(m-1))){break;}m=m+1;l.push(0);k.push(0);}return m;},_forloop:function i(o,p){var k=o/2;var l=[];for(var n=0;n<k;n=n+1){l.push(p.call(null,n));
}return l;},_convertTo:function g(u,q,p,t){var k=t||this.settings.samplingrate;var r;switch(u){case"amplitude":r=function n(v){return Math.sqrt(q[v]*q[v]+p[v]*p[v]);
};break;case"power":r=function s(v){return q[v]*q[v]+p[v]*p[v];};break;case"phase":r=function m(v){return Math.atan2(p[v],q[v]);};break;case"frequencies":r=function l(v){return k*(v)/N;
};break;case"periods":r=function o(v){return N/(k*(v));};}return this._forloop(this.dim(q,p),function(v){return r.call(null,v);});},amplitude:function b(l,k){return this._convertTo("amplitude",l,k,1);
},power:function a(l,k){return this._convertTo("power",l,k,1);},phase:function j(l,k){return this._convertTo("phase",l,k,1);},frequencies:function d(l,k,m){return this._convertTo("frequencies",l,k,m);
},periods:function h(l,k,m){return this._convertTo("periods",l,k,m);},calc:function e(u,I,F){var K,r,p,o,v,t,x,w,y,s;var z,G,D,B,A,H,E,n,q;N=this.dim(I,F);
INDEX=Math.log2(N);DX=1/N;var J=3.14159265358979;K=2*J/N;z=N;for(A=0;A<INDEX;A=A+1){r=0;n=z;z=z/2;for(B=0;B<z;B=B+1){q=B-n;y=Math.cos(r);s=-u*Math.sin(r);
r=r+K;for(D=n;D<N+1;D=D+n){H=D+q;E=H+z;p=I[H];o=I[E];v=F[H];t=F[E];I[H]=p+o;F[H]=v+t;I[E]=(p-o)*y+(v-t)*s;F[E]=(v-t)*y-(p-o)*s;}}K=2*K;}D=0;for(G=0;G<N-1;
G=G+1){if(G<D){x=I[D];w=F[D];I[D]=I[G];F[D]=F[G];I[G]=x;F[G]=w;}B=N/2;while(true){if(B>D){break;}D=D-B;B=B/2;}D=D+B;}if(u<0){for(G=0;G<N;G=G+1){I[G]=DX*I[G];
F[G]=DX*F[G];}}return[I,F];}};return c;}));
}else{if(typeof exports==="object"){module.exports=b();}else{a.FFT=b();}}}(this,function(){var c=function(j){this.settings=j||{samplingrate:1};};c.prototype={dim:function f(k,j){var l=k.length;
while(true){if(!(l&(l-1))){break;}l=l+1;k.push(0);j.push(0);}return l;},_forloop:function h(n,o){var j=n/2;var k=[];for(var l=0;l<j;l=l+1){k.push(o.call(null,l));
}return k;},amplitude:function b(k,j){return this._forloop(this.dim(k,j),function(l){return Math.sqrt(k[l]*k[l]+j[l]*j[l]);});},power:function a(k,j){return this._forloop(this.dim(k,j),function(l){return k[l]*k[l]+j[l]*j[l];
});},phase:function i(k,j){return this._forloop(this.dim(k,j),function(l){return Math.atan2(j[l],k[l]);});},frequencies:function d(l,k,m){var j=m||this.settings.samplingrate;
return this._forloop(this.dim(l,k),function(n){return j*(n)/N;});},periods:function g(l,k,m){var j=m||this.settings.samplingrate;return this._forloop(this.dim(l,k),function(n){return N/(j*(n));
});},calc:function e(u,I,F){var K,r,p,o,v,t,x,w,y,s;var z,G,D,B,A,H,E,n,q;N=this.dim(I,F);INDEX=Math.log2(N);DX=1/N;var J=3.14159265358979;K=2*J/N;z=N;
for(A=0;A<INDEX;A=A+1){r=0;n=z;z=z/2;for(B=0;B<z;B=B+1){q=B-n;y=Math.cos(r);s=-u*Math.sin(r);r=r+K;for(D=n;D<N+1;D=D+n){H=D+q;E=H+z;p=I[H];o=I[E];v=F[H];
t=F[E];I[H]=p+o;F[H]=v+t;I[E]=(p-o)*y+(v-t)*s;F[E]=(v-t)*y-(p-o)*s;}}K=2*K;}D=0;for(G=0;G<N-1;G=G+1){if(G<D){x=I[D];w=F[D];I[D]=I[G];F[D]=F[G];I[G]=x;F[G]=w;
}B=N/2;while(true){if(B>D){break;}D=D-B;B=B/2;}D=D+B;}if(u<0){for(G=0;G<N;G=G+1){I[G]=DX*I[G];F[G]=DX*F[G];}}return[I,F];}};return c;}));

0 comments on commit 3e98e94

Please sign in to comment.