Why doesnt the Fourier Transformation Work
    조회 수: 5 (최근 30일)
  
       이전 댓글 표시
    
Hello, I programmed a Fourier Transformator. Currently I generate a sine wave and Transform it. Later I want to use Sound. But I dont know how to write the Sound into a vector. But to my Question. If I run the code. I dont get a wave. I just get a Line. But what is the Problem? What is my Mistake?
wave = zeros(1,360)
samplingrate = 360
cyclestart = -100;
cyclesteps = 0.1;
cycleend = 100;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
adder = 0
for a = 1:length(wave)
  wave(a) = 10*sin(a/36);   %%<== only temporarily for generating a wave in the final version I want to read audio into a vector.
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
seconds = length(wave)/samplingrate;
b = 1;
plotx = cyclestart:cyclesteps:cycleend;
ploty = cyclestart:cyclesteps:cycleend;
for i = cyclestart:cyclesteps:cycleend
  centerx = 0;
  centery = 0;
  averagepoint=0
  for c = 1:length(wave)
    centerx = wave(c)*cos(2*pi*i*seconds/length(wave)*c);
    centery = wave(c)*sin(2*pi*i*seconds/length(wave)*c);
    averagepoint = averagepoint + sqrt(centerx*centerx+centery*centery);
  end     
  ploty(b)=averagepoint*length(wave)/samplingrate;
  disp(datestr(now,'HH:MM:SS.FFFFFF')); 
  disp(i);
  b = b + 1;
end
xlabel('Frequency');
plot(plotx,ploty);
댓글 수: 0
답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!