필터 지우기
필터 지우기

Why doesnt the Fourier Transformation Work

조회 수: 4 (최근 30일)
dieter alfred
dieter alfred 2020년 7월 16일
편집: dieter alfred 2020년 7월 16일
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개)

카테고리

Help CenterFile Exchange에서 Discrete Fourier and Cosine Transforms에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by