From e75514280d5fc287f6f56b1f6d947ec8f4577104 Mon Sep 17 00:00:00 2001 From: Himanshu4746 Date: Sat, 29 Jul 2017 15:29:39 +0530 Subject: [PATCH] removed redundant code --- effects.cpp | 12 +---------- main.cpp | 62 ++++++++++++++--------------------------------------- 2 files changed, 17 insertions(+), 57 deletions(-) diff --git a/effects.cpp b/effects.cpp index ebe47a2..1b10a79 100644 --- a/effects.cpp +++ b/effects.cpp @@ -32,15 +32,9 @@ void bars() glEnd(); } //sync - //j++; - //Sleep(97); - - //sync3 if( curtime > (j*100+100)) { j++; - //cout<<"arr_sz: "<<(int)avgarr.size()<<" j:"< (j*100+100)) { j++; - //cout<<"arr_sz: "<<(int)avgarr.size()<<" j:"< (j*100+100)) { j++; - //cout<<"arr_sz: "<<(int)avgarr.size()<<" j:"< (j*100+100)) { j++; - //cout<<"arr_sz: "<<(int)avgarr.size()<<" j:"<60 && f<=250) { - val = graph[i] = abs((float)(log(mag[i]) * 10)/8.0); + val = abs((float)(log(mag[i]) * 10)/8.0); } else if (f>250 && f<=500) { - val = graph[i] = abs((float)(log(mag[i]) * 10)/7.0); + val = abs((float)(log(mag[i]) * 10)/7.0); } else if (f>500 && f<=2000) { - val = graph[i] = abs((float)(log(mag[i]) * 10)/6.0); + val = abs((float)(log(mag[i]) * 10)/6.0); } else if (f>2000 && f<=4000) { - val = graph[i] = abs((float)(log(mag[i]) * 10)/5.0); + val = abs((float)(log(mag[i]) * 10)/5.0); } else if (f>4000 && f<=6000) { - val = graph[i] = abs((float)(log(mag[i]) * 10)/4.0); + val = abs((float)(log(mag[i]) * 10)/4.0); } else if (f>6000 && f<=20000) { - val = graph[i] = abs((float)(log(mag[i]) * 10)/3.5); + val = abs((float)(log(mag[i]) * 10)/3.5); } else { - val = graph[i] = abs((float)(log(mag[i]) * 10)/2.0); + val = abs((float)(log(mag[i]) * 10)/2.0); } - //std::cout<<"amp: "<::size_type sz = ampdb.size(); //frequency mapping of amplitudes int k=0; for(int i=0;i<(SAMPLE_COUNT)/(SAMPLE_RATE*0.1);i++) { - //cout< temp={0}; int cnt[60]={0}; for(int j=0;j<(SAMPLE_RATE*0.1)/2;j++) @@ -388,22 +374,16 @@ void loadData(){ temp[j]/=cnt[j]; } avgarr.push_back(temp); - /* - //print display data - for(int ppp=0;ppp<60;ppp++) - cout<