【发布时间】:2011-04-27 15:48:21
【问题描述】:
如何使用 fft/ifft 增加/减少(频率/音高)和相位
有人告诉我 repmat 和 resample 可能会有所帮助,是的,我想线性移动所有组件。我想随着时间的推移调整相位,以便它产生驻波。一个信号的相位朝一个方向变化,另一个信号的相位朝相反的方向变化
PS:它是在 Octave/matlab 代码中完成的
例如,我有一个每秒重复 1 次的信号,而我想让它每秒重复 3 次。
%Voiceprint raise lower freq phase conjugate signal
tic
clear all, clc,clf,tic
%% Sound /beep calculation complete
filerawbeepStr='calculations_complete.wav';
filerawbeeppathStr='/home/rat/Documents/octave/raw/';
filevoiceprepathStr='/home/rat/Documents/octave/eq_research/main/transform/voice/';
filewavpathStr='/home/rat/Documents/octave/eq_research/main/transform/wav/';
[ybeep, Fsbeep, nbitsbeep] = wavread(strcat(filerawbeeppathStr,filerawbeepStr));
%addpath(”/home/rat/Documents/octave/eq_research/main/transform/”); %add path to location of functions
%1a voice print import
[vp_sig_orig, fs_rate, nbitsraw] = wavread(strcat(filevoiceprepathStr,'voice8000fs.wav'));
%vp_sig_orig=vp_sig_orig’;
vp_sig_len=length(vp_sig_orig);
%2a create frequency domain
ya_fft = fft(vp_sig_orig);
vp_sig_phase_orig = unwrap(angle(ya_fft));
%get Magnitude
ya_fft_mag = abs(ya_fft);
%3a frequency back to time domain
ya_ifft=real(ifft(ya_fft));
%adjust frequency/phase here? How?
vp_sig_new=real(ifft(ya_fft_mag.*exp(i*vp_sig_phase_orig)));
subplot(3,1,1), plot(vp_sig_orig),title('1 original time domain')
subplot(3,1,2), plot(ya_ifft),title('2 rebuild time domain')
subplot(3,1,3), plot(vp_sig_new),title('3 adjusted time')
【问题讨论】:
-
如何你想修改每个组件的频率,确切地说?所有组件的固定(即线性)移位?通过常数因子(即对数移位)缩放所有组件?你到底想对这个阶段做什么(以及为什么)?
-
@Paul R 有人告诉我 repmat 和 resample 可能会有所帮助,是的,所有组件的线性移位。我想随着时间的推移调整相位,以便它产生驻波。一个信号的相位朝一个方向变化,另一个信号的相位朝相反的方向变化
-
好的 - 您可能应该编辑您的问题以包含此信息 - 然后您将更清楚您要实现的目标是什么