How would you use the MATLAB commands conv & randn to generate a random baseband signal of a specified bandwidth in MATLAB?
I have the equation: m=conv(randn(1,9501),ones(1,500))/100, which [supposedly] produces a bandwidth of about 20Hz, but I don't understand how to modify the signal to obtain the desired bandwidth of 10Hz.
I want to apply this signal in QAM and SSB-SC.
Related
If I wanted to get the SNR of a quantized audio signal, would I subtract the quantized signal from the original (which would give me the noise?) and then calculate the power of this noise and compare it to the power of the original signal?
Such as, SNR(dB)=10*log(original power/noise power)
Yes, that is the quantization noise. It is not just “noise” because the input has noise as well, and you don’t include that noise in your result.
Assuming I have two signals (raw data as excel file) measured from two different power supplies, I want to compare the noise-levels of these signals to find out which one of them the noisier one. Both power supplies produce signals with the same frequency but the amount of data points are different. Is there a way to do this in MATLAB?
You could calculate the signal-to-noise ratio for each signal. This is just a ratio of the average signal power and average noise power, usually measured in decibels. An ideal noiseless signal would have SNR = infinity.
Recall that signal power is just the square of the signal amplitude, and to get the value x in decibels, we just take 10*log10(x).
SNR = 10*log10( mean(signal.^2)/mean(noise.^2) );
To separate the signal from the noise, you could run a low-pass filter over the noisy signal.
To get the noise you could just subtract the clean signal from the noisy signal.
noise = noisy_signal - signal;
How to know the number of maximum and minimum peaks in a signal, and each peak its value, with input of random and real-time signal using simulink in matlab?
i want to show the signal modulate in simulink but i don't know how to make it
The Spectrum Scope calculates the FFT of the input signal.
In your model you are trying to take the fft of the fft.
(Although you aren't quite doing that as the input to the FFT block needs to be buffered so that the FFT has a vector of data over which to calculate the FFT.)
Remove your FFT and Abs blocks and feed the signal directly into the Spectrum Scope.
Use the block's dialog to set the buffer and FFT length that you want to use.
Phil.
So I have the samples (hex values) of a sinus signal and I know the sampling frequency. Using this I can plot an fft or periodogram but then I would like to find out the SNR ratio. What would be the most accurate way to calculate the noise and signal power? I would prefer doing it in frequency domain. Is there a way to do this also in time domain?
Thanks a lot in advance!!!
So if there is noise on your signal and you know that your underlying signal is a sine wave, you can easily get your signal parameters i.e. amplitude,frequency and phase by least squares. If y(t) is your signal just minimize the L2 norm of (y(t)-A.sin(wt+b)) over A,w and b. Then you can easily get signal power from the underlying signal and the noise power from the error signal (y(t)-A.sin(wt+b)).