Answer and Explanation:
Given that
X = sig_noise( [f₁ f₂],SNR,N)
where f₁ = 300 Hz and f₂ = 340 Hz
SNR = -12 db
N = 128 or 512
hence, we have,
X = sig_noise([320 340] -12.128)
or
X = sig_noise([320 340] -12.512)
in this question, we assume our [tex]f_{s}[/tex] to be 1 kHz
y = fft(x)
power spectrum (PS)
(PS) =abs (y).^2
[tex]Freq = (1:N)/f_{s}[/tex]
plot(freq, 20*log10(ps),'k');
attached below is a sample waveform to expect