fft - Add a sinusoid to a speech file in MATLAB -
i have speech file , attempting add sinusoid of frequency 300 hz speech sample, following code:
% add sine wave speech signal clear all; close all; load spf2.mat; % sound(speech) pxx= pwelch(speech); plot(pxx); xlim([0 500]); f0 = 300; %hz fs = 8000; % samples per second dt = 1/fs; % seconds per sample stoptime = 2.74775; % seconds t = (0:dt:stoptime-dt)'; % seconds y = sin(2*pi*f0*t); newspeech = speech + y; sound(newspeech) pxx= pwelch(newspeech); figure plot(pxx); xlim([0 500]);
however, not appear added signal properly.
the power spectrum of original signal , power spectrum of 'newspeech' (which should contain original speech , sinusoid) same!
fig 1: power spectrum of original speech file 0 500 hz
fig 2: power spectrum of new speech signal 0 500 hz
please let me know going wrong.
Comments
Post a Comment