如何增加/减少信号(频率/音调)
如何使用 fft/ifft 增加/减少(频率/音调)和相位 我想我有基本代码,但我不确定下一步该做什么
我被告知 repmat 和重新采样可能有帮助,是的,我想线性移位所有成分。我想随着时间的推移调整相位,以便产生驻波。一个信号的相位沿一个方向变化,另一个信号的相位沿相反方向变化
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')
How can I increase/decrease (frequency/pitch) and phase using fft/ifft I think I have the basic code but I’m not sure what to do next
I was told repmat and resample may help, yes I want to linear shift all components. I want to adjust the phase over time so that it will create a standing wave. One signal with the phase changing in one direction and another signal with the phase going the opposite direction
PS: It's done in Octave/matlab code
Example I have a signal that's repeats 1 time every second and I want to have it repeat 3 times a second instead.
%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')
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是实现此目的的一种方法,但如果信号很大,您可能必须增加信号的点数
This is one way to do this but if the signal is large you may have to increase the number of points to the signal