我正試圖將圖像轉換爲音頻信號,將其視爲譜圖as in Aphex Twin's song on Windowlicker。不幸的是,我無法獲得結果。逆向頻譜圖在MATLAB中的La Aphex Twin
這是我目前所面對的:
function signal = imagetosignal(path, format)
% Read in the image and make it symmetric.
image = imread(path, format);
image = [image; flipud(image)];
[row, column] = size(image);
signal = [];
% Take the ifft of each column of pixels and piece together the real-valued results.
for i = 1 : column
spectrogramWindow = image(:, i);
R = abs(ifft(spectrogramWindow));
% Take only the results for the positive frequencies.
signalWindow = R(1 : row/2.0);
signal = [signal; signalWindow];
end
end
所以,我走我的圖像列逆傅立葉變換,然後把它們放在一起,形成一個信號。此外,此功能使用MATLAB的圖像處理工具箱來讀取圖像。我們的目標是有一些變化
spectrogram(imagetosignal('image', 'bmp'));
導致東西看起來像原始圖像。我非常感謝任何幫助!我只是在學習信號處理,所以如果存在明顯的誤解,請不要感到驚訝。謝謝!
編輯:感謝戴夫!我得到它的工作!我結束了這一點:
function signal = imagetosignal(path, format)
% Read in the image and make it symmetric.
image = imread(path, format);
image = [image; flipud(image)];
[row, column] = size(image);
signal = [];
% Take the ifft of each column of pixels and piece together the results.
for i = 1 : column
spectrogramWindow = image(:, i);
signalWindow = real(ifft(spectrogramWindow));
signal = [signal; signalWindow];
end
end
那麼,究竟是什麼問題呢? – gnovice 2009-08-05 03:24:37
在回來的路上,圖像的上半部分被有效地丟失了,並且可怕的東西仍然會留下污跡。 – 2009-08-05 03:33:53