- Generate three sinusoids with frequencies of 60 Hz, 70 Hz, and 100 Hz.
- Ensure that each sinusoid has a power of 1 (unity power).
- Add white Gaussian noise with a power of -6 dB relative to the signal power.
- Sample the signal at a rate of 250 Hz.
To calculate the noise power, you need to relate it to the signal power. If the signal has a power of 1 (0 dB), then the noise needs to have a power of 0.5 (since -6 dB is half the power on a linear scale).
frequencies = [60, 70, 100];
signal = cos(2 * pi * frequencies(1) * t) + ...
cos(2 * pi * frequencies(2) * t) + ...
cos(2 * pi * frequencies(3) * t);
signal = signal / sqrt(mean(signal.^2));
noise_power_linear = 10^(noise_power_db / 10);
noise = sqrt(noise_power_linear / 2) * randn(1, length(t));
noisy_signal = signal + noise;
title('Original Signal');
This code generates the required signal and noise, adds them together, and then plots both the original clean signal and the noisy signal. Please adjust the code if needed to fit the specific requirements of your application or simulation environment.
------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
Professional Interests
- Technical Services and Consulting
- Embedded Systems | Firmware Developement | Simulations
- Electrical and Electronics Engineering