Vector dimensions not right
Mostrar comentarios más antiguos
trying to added the cosine wave as a noise vector to the pwelch command, but the software says 'Matrix dimensions must agree'. What's wrong with my code?
f2 = 5000;
A2 = 0.25;
t2 = 0:1/f2:5-1/f2;
x2 = A2*cos(2*pi*f2*t)+randn(size(t2));
[y,Fs]=audioread('doorbell.wav');
[pxx,f] = pwelch(x2,[],[],[],Fs);
plot(f,10*log10(pxx)); xlabel('Frequency (Hz)'); ylabel('PSD (dB/Hz)');
1 comentario
Walter Roberson
el 29 de Sept. de 2019
What size is t ? You do not show us the initialization for it.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Parametric Spectral Estimation en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
