I've got 2 noise vectors(x1 and x2) that I need to add to the pwelch command but I can't figure out what's wrong with my code. How do I add the 2 vectors together for the pwelch command? please help. code is below
f1 = 4000; %sinusoidal frequency
A1 = 0.2; %amplitude
f2 = 5000; %sinusoidal frequencyA2 = 0.25; %amplitudet1 = 0:1/f1:5-1/f1;t2 = 0:1/f2:5-1/f2;x1 = A1*cos(2*pi*f1*t)+randn(size(t1));x2 = A2*cos(2*pi*f2*t)+randn(size(t2));x = x1+x2;[y,Fs]=audioread('doorbell.wav');[pxx,f] = pwelch(x,500,300,500,Fs);plot(f,10*log10(pxx)); xlabel('Frequency (Hz)'); ylabel('PSD (dB/Hz)');
Best Answer