0

I have calculated the fft values and stored them in a cell array with each vector containing the fft values corresponding to each input audio signal.This is my code :

for k=1 : length(rseg)
    rfft{k} = fft(rseg{k});
end
for k=1 : length(rotate)
    igray{k} =  255 * mat2gray(uint8(rotate{k}));
end
Adriaan
  • 17,741
  • 7
  • 42
  • 75
  • I am really confused, what is this variable rotate, let's assume you have obtained the fft (why is the variable rfft a cell array I have no idea) - you need to take the magnitude (real part) of the fft and then convert it into a grayscale of 0-255? – GameOfThrows Mar 02 '16 at 09:46
  • I meant the button with the image {}, on the editing panel. You are right, ctrl + k works too. – Lincoln Cheng Mar 02 '16 at 09:48
  • @GameOfThrows : We actually have 535 input audio files, each file is stored as a vector, collectively in a cell array. Rotate is also a cell array in which we rotated the cell array (rfft) by 90 degrees.Can you please tell how to take the magnitude of real part in matlab? – code_freak Mar 02 '16 at 10:15
  • you can either do `real(fft_result)` for the real part of the complex magnitude or `abs(fft_result)` the complex magnitude (they do not give same answers! abs should be preferred, but it depends on your assignment really.) also you might want to use `log magnitude` where you will need to `log(abs(fft_result))` - but Note that the log magnitude response is different from magnitude response; after this you should be able to convert it into a grayscale using `mat2gray` – GameOfThrows Mar 02 '16 at 10:24
  • @GameOfThrows Thank you! – code_freak Mar 02 '16 at 10:27

0 Answers0