【正文】
each row of plex_carrier_matrix represents one symbol period, with% a symbol for each carrier% a matrix is generated to represent all IFFT bins (columns) and all % symbols (rows) % the phase modulation for each carrier is then assigned to the % appropriate bin % the conjugate of the phase modulation is then assigned to the % appropriate bin% the phase modulation bins and their conjugates are symmetric about % the Nyquist frequency in the IFFT bins% since the first bin is DC, the Nyquist Frequency is located % at (number of bins/2) + 1 % symmetric conjugates are generated so that when the signal is % transformed to the time domain, the time signal will be realvalued % example% 1024 IFFT bins % bin 513 is the center (symmetry point) % bin 1 is DC% bin 514 is the plex conjugate of bin 512 % bin 515 is the plex conjugate of bin 511 % .... % bin 1024 is the plex conjugate of bin 2 (if all bins % were used as carriers) % So, bins 2512 map to bins 1024514 % IFFT_modulation = zeros(symbols_per_carrier + 1, IFFT_bin_length)。b*39。IFFT Bin39。go39。b*39。IFFT Bin39。s spectrum (represented by a row of carriers) to the % time domain via IFFT% time_wave_matrix = ifft(IFFT_modulation39。start39。Time39。r39。b39。r39。b39。r39。b39。r39。b39?!?for f = 1:carrier_count % temp_bins(1:IFFT_bin_length)=0+0j。)。Time39?!? windowed_time_wave_matrix(i,:) = real(time_wave_matrix(i,:))。, 1, IFFT_bin_length*(symbols_per_carrier+1))。)%xlabel(39。)% % PLOT OFDM SIGNAL (spectrum)%symbols_per_average = ceil(symbols_per_carrier/5)?! ?for a = 0:(averages1)% subset_ofdm = ofdm_modulation(((a*avg_temp_time)+1):((a+1)*avg_temp_time))?!?figure (6) %plot((0:(avg_temp_time1))/avg_temp_time, average_fft_log) %hold on %plot(0:1/IFFT_bin_length:1, 35, 39。) %xlabel(39。) % % ENDPLOT %% Upconversion to RF % % For this model, the baseband will be inserted directly into the channel % without conversion to RF frequencies. %Tx_data = ofdm_modulation。 noise_scale_factor = sqrt(noise_sigma)。%% Transform each symbol from time to frequency domain% take the fft of each column% Rx_spectrum = fft(Rx_Data_matrix)。Magnitude39。OFDM Receive Spectrum, Magnitude39。b*39。Phase (degrees)39。OFDM Receive Spectrum, Phase39?!olar(Rx_phase_P, Rx_mag_P,39?! hase_negative = find(Rx_phase 0)?!x_decoded_phase(phase_negative) = rem(Rx_decoded_phase(phase_negative)+360,360)?! ? % Extract phase differences (from the differential encoding) % the matlab diff( ) function is perfect for this operation % again, normalize the result to be between 0 and 359 degrees % Rx_decoded_phase = diff(Rx_phase)。)。%% PLOT EACH RECEIVED SYMBOL %figure (9) Rx_phase_P = angle(Rx_carriers)。FFT Bin39。b*39。go39。FFT Bin39。b*39?! x_Data = Tx_data + noise?! ?linear_SNR = 10^(SNR/10)。) %title(39。)%grid on%axis([0 40 max(average_fft_log)]) %ylabel(39?!? average_fft = average_fft + (subset_ofdm_f/averages)?! ?averages = floor(temp_time/avg_temp_time)。) %title(39。%figure (5) %plot(0:temp_time1,ofdm_modulation)%grid on %ylabel(39。reshape39。Separated Time Waveforms Carriers39。Amplitude39。 % temp_bins(conjugate_carriers(f))=IFFT_modulation(2,conjugate_carriers(f))。k39。g39。k39。g39。k39。g39。k39。g39。OFDM Time Signal, One Symbol Period39。Amplitude39?!ime_wave_matrix = time_wave_matrix39。OFDM Carrier Phase39。Phase (degrees)39。b*39。OFDM Carrier Frequency Magnitude39。Magnitude39?!FFT_modulation(:,conjugate_carriers) = conj(plex_carrier_matrix)?! ?% Convert the phase to a plex number% each symbol is given a magnitude of 1 to go along with its phase % (via the ones(r,c) function) % it is then converted from polar to cartesian (plex) form % the result is 2 matrices, X with the real values and Y with the imaginary% each X column has all the real values for a carrier, and each Y column % has the imaginary values for a carrier% a single plex matrix is then generated taking X for real and % Y for imaginary %[X,Y] = pol2cart(carrier_matrix, ones(size(carrier_matrix,1),size(carrier_matrix,2)))。y] of a row of zeros with the carrier matrix, sweet!) % perform modulo N addition between symbol(n) and symbol(n1) to get the % coded value of symbol(n) % for example: % bits_per_symbol = 2 (modulo 4) % symbol stream = 3 2 1 0 2 3 % start symbol = 0 %% coded symbols = 0 + 3 = 3% 3 + 2 = 11 = 1 % 1 + 1 = 2% 2 + 0 = 2 % 2 + 2 = 10 = 0 % 0 + 3 = 3% % coded stream = 0 3 1 2 2 0 3 %%carrier_matrix = [zeros(1,carrier_count)?! or k = 1:(length(baseband_out)/bits_per_symbol) modulo_baseband(k) = 0。% %TRANSMIT % % Generate a random binary output signal: % a row of uniform random numbers (between 0 and 1), rounded to 0 or 1 % this will be the baseband signal which is to be transmitted. %baseband_out = round(rand(1,baseband_out_length))。)。symbols per carrier =39?!? bits_per_symbol = input(39。)。 % bits per symbol symbols_per_carrier = 50。)。OFDM Analysis Program\n\n39?! ∽詈蟾兄x各位老師在百忙之中給予我畢業(yè)設計的指導和批評,希望你們能夠?qū)ξ业牟蛔闾岢鰧氋F的意見和建議,最后謝謝各位老師。在整個畢業(yè)設計過程中給予我的精心指導和教導我們?nèi)绾螌懏厴I(yè)論文?! ? FFT 后的 OFDM 信號載波相位 圖 FFT 后的 OFDM 信號載波相位圖 是去掉循環(huán)前綴后進行 FFT 的 OFDM 信號載波相位?! ? OFDM 時域波形 圖 OFDM 時域波形 圖 顯示單獨子載波構(gòu)成復合的 OFDM 波形圖?! ? OFDM 信號 圖 OFDM 信號 OFDM 信號具有不同的幅