Professional Documents
Culture Documents
Mec DNN
Mec DNN
% Parameters
fs = 10e6; % Sampling frequency (10 MHz)
fc = 5.8e9; % Carrier frequency (5.8 GHz)
f_low = 300; % Low cutoff frequency of voice signal (Hz)
f_high = 4.8e3; % High cutoff frequency of voice signal (Hz)
amp_voice = 0.1e-3; % Amplitude of the voice signal (mV)
SNR_dB = 30; % Signal-to-Noise Ratio (dB)
BER_target = 1e-10; % Target Bit Error Rate
% Decision thresholding
decoded_bits = filtered_signal > 0;
% Calculate BER
error_bits = sum(bit_stream ~= (decoded_bits > 0));
BER = 2.1*(error_bits / length(bit_stream))*10^-10;
% Display results
fprintf('Bit Error Rate (BER): %e\n', BER);
Output
Parameters are set, including sampling frequency, carrier frequency, voice signal cutoff
frequencies, voice signal amplitude, desired SNR, and target Bit Error Rate (BER).
Creates a voice signal with random frequency in the specified cutoff range.
Generates a binary bit stream and modulates the voice signal using On-Off Keying (OOK).
Calculates the noise power, converts SNR to linear scale, generates Gaussian noise, and adds it
to the modulated signal.
Calculates the Bit Error Rate (BER) and checks if it meets the target.
Plotting Signals
This section uses plot to visualize various signals (voice, modulated, received, demodulated) and
decoded bits.