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!

image 1: power spectrum of original speech file 0 500 hz
fig 1: power spectrum of original speech file 0 500 hz

image 2: power spectrum of new speech signal 0 500 hz
fig 2: power spectrum of new speech signal 0 500 hz

please let me know going wrong.

you have scaling issue, power of sinusoid alone:

pwelch of sinusoid

and peak power of audio signal ~1e8


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -