亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ofdm程序解析.m

?? OFDM仿真
?? M
?? 第 1 頁 / 共 2 頁
字號:
for i=1+d1:length(recv)
	copy1(i)=a1*recv(i-d1);
end
copy2=zeros(size(recv));
for i=1+d2:length(recv)
	copy2(i)=a2*recv(i-d2);
end
recv=recv+copy1+copy2;

% 3.2.3、%ch_noise                     %施加信道噪聲
% ch_noise (operate on recv)
% random noise defined by noise_level amplitude
if already_made_noise == 0	% only generate once and use for both QAM and OFDM
	noise = (rand(1,length(recv))-0.5)*2*noise_level;
	already_made_noise = 1;
end
recv = recv + noise;

% 3.3 %rx.m                        %接收程序
% rx
disp('Receiving')
rx_chunk

% perform fft to recover original data from time domain sets
recv_spaced_chunks = zeros(num_chunks,fft_size);
for i = 1:num_chunks
	recv_spaced_chunks(i,1:fft_size) = fft(recv_td_sets(i,1:fft_size));
	% Note: 'round()' gets rid of small numerical error in Matlab but a threshold will be needed for a practical system
	% 2001-4-17 -- Got rid of 'round()' to do decoding more intelligently
end
rx_dechunk
output = pol2bin(output);	% Converts polar to binary
write

% 3.3.1 %rx_chunk.m
% rx_chunk
% break received signal into parellel sets for demodulation
recv_td_sets = zeros(num_chunks,fft_size);
for i = 1:num_chunks
	for k = 1:fft_size
		recv_td_sets(i,k) = recv(k + (i-1)*fft_size);
	end
end

% 3.3.2 % rx_dechunk             %并串轉換
% rx_dechunk
% take out zeros_between from recv_spaced_chunks --> recv_padded_chunks
recv_padded_chunks = zeros(num_chunks, num_carriers+num_zeros);
i = 1;
for k = zeros_between +1:zeros_between +1:fft_size/2
	recv_padded_chunks(1:num_chunks,i) = recv_spaced_chunks(1:num_chunks,k);
	i = i+1;
end

% take out num_zeros from padded chunks --> recv_chunks
recv_chunks = zeros(num_chunks, num_carriers);
recv_chunks = recv_padded_chunks(1:num_chunks, num_zeros+1:num_carriers+num_zeros);

% Recover bit stream by placing reconstructed frequency domain data in series
recv_dechunked = zeros(1, num_chunks*num_carriers);
for i = 1:num_chunks
	for k = 1:num_carriers
		recv_dechunked(k + (i-1)*num_carriers*2) = real(recv_chunks(i,k));
		recv_dechunked(k + (i-1)*num_carriers*2 + num_carriers) = imag(recv_chunks(i,k));
	end
end

% take out trailing zeros from output --> output
output_analog = recv_dechunked(1:data_length);
output = sign(output_analog);

% 3.3.3 %write               %save received data
% write
% ******************TEST OUTPUT*********************************
if input_type == 1
	if test_input_type == 1
		%already binary - do nothing
	end
	
	if (test_input_type == 2) | (test_input_type == 3)
		%random input     OR     sine wave samples
		output_samples = zeros(1,floor(length(output)/8));  %extra zeros are not original data
		for i = 1:length(output_samples)
			output_samples(i) = bin2eight(output(1 + (i-1)*8:(i-1)*8 + 8));
		end
		if do_QAM == 1
			QAM_output_samples = zeros(1,floor(length(QAM_data_out)/8));
			for i = 1:length(QAM_output_samples)
				QAM_output_samples(i) = bin2eight(QAM_data_out(1 + (i-1)*8:(i-1)*8 + 8));
			end
		end
	end
end

% ******************FILE OUTPUT*********************************
if input_type == 2

	if file_input_type == 1
		%binary file output - not implemented
	end

	if file_input_type == 2
		%text file output
		output_samples = zeros(1,floor(length(output)/8));  %extra zeros are not original data
		for i = 1:length(output_samples)
			output_samples(i) = bin2eight(output(1 + (i-1)*8:(i-1)*8 + 8));
		end
		file = fopen('OFDM_text_out.txt','wt+');
		fwrite(file,output_samples,'char');
		fclose(file);

		if do_QAM == 1
			%extra zeros are not original data
			QAM_output_samples = zeros(1,floor(length(QAM_data_out)/8));  
			
for i = 1:length(QAM_output_samples)
				QAM_output_samples(i) = bin2eight(QAM_data_out(1 + (i-1)*8:(i-1)*8 + 8));
			end
			file = fopen('QAM_text_out.txt','wt+');
			fwrite(file,QAM_output_samples,'char');
			fclose(file);
		end
	end

	if file_input_type == 3
		output_samples_big = zeros(1,floor(length(output)/8));  %extra zeros are not original data
		for i = 1:length(output_samples_big)
			output_samples_big(i) = bin2eight(output(1 + (i-1)*8:(i-1)*8 + 8));
		end
		%convert dynamic range from 0:255 to -1:1
		output_samples = (output_samples_big-127)/128;
		%sound file output
		wavwrite(output_samples, 11025, 8, 'OFDM_out.wav')
		if do_QAM == 1
			QAM_data_out_big = zeros(1,floor(length(QAM_data_out)/8));
			for i = 1:length(QAM_data_out_big)
				QAM_data_out_big(i) = bin2eight(QAM_data_out(1 + (i-1)*8:(i-1)*8 + 8));
			end
			%convert dynamic range from 0:255 to -1:1
			QAM_output_samples = (QAM_data_out_big-127)/128;
			%sound file output
			wavwrite(QAM_output_samples, 11025, 8, 'QAM_out.wav')
		end
	end
	
	if file_input_type == 4
		%image file output - not implemented		
	end
end

% 4、%Analysis.m
% Analysis
disp(' '), disp('------------------------------------------------------------')
disp('Preparing Analysis')
figure(1), clf
if (input_type == 1) & (test_input_type == 1)
	subplot(221), stem(data_in), title('OFDM Binary Input Data');
	subplot(223), stem(output), title('OFDM Recovered Binary Data')
else
	subplot(221), plot(data_samples), title('OFDM Symbol Input Data');
	subplot(223), plot(output_samples), title('OFDM Recovered Symbols');
end
subplot(222), plot(xmit), title('Transmitted OFDM');
subplot(224), plot(recv), title('Received OFDM');


% dig_x_axis = (1:length(QAM_tx_data))/length(QAM_tx_data);
% 	figure(4), clf, subplot(212)
% 	freq_data = abs(fft(QAM_rx_data));
% 	L = length(freq_data)/2;
	
dig_x_axis = (1:length(xmit))/length(xmit);
figure(2), clf

if channel_on ==1
	num = [1, zeros(1, d1-1), a1, zeros(1, d2-d1-1), a2];
	den = [1];
	[H, W] = freqz(num, den, 512);
	mag = 20*log10(abs(H));
	phase = angle(H) * 180/pi;
	
	subplot(313)
	freq_data = abs(fft(recv));
	L = length(freq_data)/2;
	plot(dig_x_axis(1:L), freq_data(1:L))
	xlabel('FFT of Received OFDM')
	axis_temp = axis;
	
	subplot(311),
	freq_data = abs(fft(xmit));
	plot(dig_x_axis(1:L), freq_data(1:L)), axis(axis_temp)
	title('FFT of Transmitted OFDM')
	
	subplot(312)
	plot(W/(2*pi),mag),
	ylabel('Channel Magnitude Response')
else
	subplot(212)	
	freq_data = abs(fft(recv));
	L = length(freq_data)/2;
	plot(dig_x_axis(1:L), freq_data(1:L))
	xlabel('FFT of Received OFDM')
	axis_temp = axis;
	
	subplot(211),
	freq_data = abs(fft(xmit));
	plot(dig_x_axis(1:L), freq_data(1:L)), axis(axis_temp)
	title('FFT of Transmitted OFDM')
end

% if file_input_type == 4
% 	figure(5)
% 	subplot(211)
% 	image(data_in);
% 	colormap(map);
% 	subplot(212)
% 	image(output);
% 	colormap(map);
% end

if do_QAM == 1 	% analyze if QAM was done
	
	figure(3), clf
	if (input_type == 1) & (test_input_type == 1)
		subplot(221), stem(data_in), title('QAM Binary Input Data');
		subplot(223), stem(QAM_data_out), title('QAM Recovered Binary Data')
	else
		subplot(221), plot(data_samples), title('QAM Symbol Input Data');
		subplot(223), plot(QAM_output_samples), title('QAM Recovered Symbols');
	end
	subplot(222), plot(QAM_tx_data), title('Transmitted QAM');
	subplot(224), plot(QAM_rx_data), title('Received QAM');
	
	dig_x_axis = (1:length(QAM_tx_data))/length(QAM_tx_data);
	figure(4), clf
	
	if channel_on ==1
		subplot(313)
		freq_data = abs(fft(QAM_rx_data));
		L = length(freq_data)/2;
		plot(dig_x_axis(1:L), freq_data(1:L))
		xlabel('FFT of Received QAM')
		axis_temp = axis;
		
		subplot(311),
		freq_data = abs(fft(QAM_tx_data));
	 	plot(dig_x_axis(1:L),freq_data(1:L)), axis(axis_temp)
		title('FFT of Transmitted QAM')
		
		subplot(312)
		plot(W/(2*pi),mag)
		ylabel('Channel Magnitude Response')
	else
		subplot(212)
		freq_data = abs(fft(QAM_rx_data));
		L = length(freq_data)/2;
		plot(dig_x_axis(1:L), freq_data(1:L))
		title('FFT of Received QAM')
		axis_temp = axis;
		
		subplot(211),
		freq_data = abs(fft(QAM_tx_data));
	 	plot(dig_x_axis(1:L),freq_data(1:L)), axis(axis_temp)
		title('FFT of Transmitted QAM')
	end
		
	% Plots the QAM Received Signal Constellation
	figure(5), clf, plot(xxx,yyy,'ro'), grid on, axis([-2.5 2.5 -2.5 2.5]), hold on

% 	% Overlay plot of transmitted constellation
% 	x_const = [-1.5 -0.5 0.5 1.5 -1.5 -0.5 0.5 1.5 -1.5 -0.5 0.5 1.5 -1.5 -0.5 0.5 1.5];
% 	y_const = [-1.5 -1.5 -1.5 -1.5 -0.5 -0.5 -0.5 -0.5 0.5 0.5 0.5 0.5 1.5 1.5 1.5 1.5];
% 	plot(x_const, y_const, 'b*')

	% Overlay of constellation boundarys
	x1 = [-2 -2]; x2 = [-1 -1]; x3 = [0 0]; x4 = [1 1]; x5 = [2 2]; x6 = [-2 2];
	y1 = [-2 -2]; y2 = [-1 -1]; y3 = [0 0]; y4 = [1 1]; y5 = [2 2]; y6 = [-2 2];
	plot(x1,y6), plot(x2,y6), plot(x3,y6), plot(x4,y6), plot(x5,y6)
	plot(x6,y1), plot(x6,y2), plot(x6,y3), plot(x6,y4), plot(x6,y5)	

	hold off
	title('16-QAM Received Signal Constellation and Decision Boundarys')
	
	binary_err_bits_QAM = 0;
	for i = 1:length(data_in)
		err = abs(data_in(i)-QAM_data_out(i));
		if err > 0
			binary_err_bits_QAM = binary_err_bits_QAM + 1;
		end
	end
	BER_QAM = 100 * binary_err_bits_QAM/data_length;
end

figure(6), clf
if channel_on == 1
	subplot(211), plot(W/(2*pi),mag),title('Channel Magnitude Response')
	xlabel('Digital Frequency'),ylabel('Magnitude in dB')
	subplot(212), plot(W/(2*pi),phase),title('Channel Phase Response')
	xlabel('Digital Frequency'),ylabel('Phase in Degrees')
else
	title('Channel is turned off - No frequency response to plot')
end

% Compare output to input and count errors
binary_err_bits_OFDM = 0;
for i = 1:length(data_in)
	err = abs(data_in(i)-output(i));
	if err > 0
		binary_err_bits_OFDM = binary_err_bits_OFDM +1;
	end
end
BER_OFDM = 100 * binary_err_bits_OFDM/data_length;
disp(strcat('OFDM: BER=', num2str(BER_OFDM,3), ' %'))
disp(strcat('      Number of error bits=', num2str(binary_err_bits_OFDM)))

if (do_QAM == 1)
	disp(strcat('QAM:  BER=', num2str(BER_QAM,3), ' %'))
	disp(strcat('      Number of error bits=', num2str(binary_err_bits_QAM)))
end

% Display text file before and after modulation
if (input_type == 2) & (file_input_type == 2)
	original_text_file = char(data_samples')
	if do_QAM ==1
		edit QAM_text_out.txt
	end
	edit OFDM_text_out.txt
end

% Listen to sounds
if (input_type == 2) & (file_input_type == 3)
	do_again = '1';
	while ( ~(isempty(do_again)) )
		disp(' ')
		disp('Press any key to hear the original sound'), pause
		sound(data_samples,11025)
		disp('Press any key to hear the sound after OFDM transmission'), pause
		sound(output_samples,11025)
		if do_QAM == 1
			disp('Press any key to hear the sound after QAM transmission'), pause
			sound(QAM_output_samples,11025)
		end
		do_again = '';
		do_again = input('Enter "1" to hear the sounds again or press "Return" to end  ', 's');
	end
end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
爽好久久久欧美精品| 国产乱码精品一区二区三区av| 午夜精品一区在线观看| 国产又黄又大久久| 欧洲在线/亚洲| 国产欧美一区二区精品婷婷| 亚洲线精品一区二区三区| 国产一区二区三区免费| 91国产丝袜在线播放| 国产欧美日韩视频一区二区| 日韩国产高清影视| 91视视频在线观看入口直接观看www| 91精品国产高清一区二区三区 | 久久精品一区四区| 亚洲观看高清完整版在线观看| 成人教育av在线| 日韩精品一区二区三区蜜臀| 香蕉av福利精品导航 | 国产麻豆视频精品| 91精品国产综合久久久蜜臀图片 | 精品蜜桃在线看| 日韩主播视频在线| 欧美日韩一区二区三区视频| 中文字幕一区二区三区四区不卡 | 日本不卡不码高清免费观看| 在线观看国产日韩| 中文字幕一区二区三区在线观看 | 久久这里只有精品视频网| 亚洲va欧美va人人爽| 欧美午夜精品一区二区蜜桃| 中文字幕一区二区视频| 成人免费视频网站在线观看| 欧美激情综合五月色丁香| 九九热在线视频观看这里只有精品| 欧美日产在线观看| 亚洲第一av色| 欧美图区在线视频| 亚洲成人精品一区二区| 欧美色视频一区| 视频一区二区中文字幕| 91精品国模一区二区三区| 日本欧美加勒比视频| 51精品秘密在线观看| 免费日韩伦理电影| 精品电影一区二区三区| 国产一区二区三区香蕉| 久久精品网站免费观看| 丁香啪啪综合成人亚洲小说 | 欧美一区二区三区啪啪| 久久精品国产网站| 国产亚洲欧洲997久久综合 | 色综合久久综合| 一区二区三区在线看| 制服丝袜国产精品| 激情综合五月婷婷| 中文字幕免费不卡在线| 91免费版pro下载短视频| 亚洲国产中文字幕| 日韩午夜电影av| 懂色av一区二区三区免费观看| 日韩毛片一二三区| 欧美日韩免费电影| 黄色小说综合网站| 亚洲欧美日韩人成在线播放| 欧美性受xxxx黑人xyx性爽| 奇米亚洲午夜久久精品| 国产精品丝袜一区| 欧美日韩成人激情| 国产麻豆视频一区二区| 一区二区三区四区视频精品免费| 51精品久久久久久久蜜臀| 国产毛片精品国产一区二区三区| 亚洲欧美视频在线观看| 精品日韩一区二区三区| 91日韩精品一区| 理论电影国产精品| 亚洲视频一区二区在线| 欧美mv日韩mv国产网站app| 成人夜色视频网站在线观看| 婷婷丁香久久五月婷婷| 国产精品久久看| 91精品国产免费| 一本一本大道香蕉久在线精品| 久久国内精品视频| 成人欧美一区二区三区在线播放| 日韩一级成人av| 色综合久久久久| 国产一区二区精品久久99| 一区二区三区在线看| 中文字幕国产精品一区二区| 欧美一区二区三区啪啪| 91国偷自产一区二区使用方法| 国产盗摄视频一区二区三区| 日本欧美在线看| 亚洲成人一区二区在线观看| 国产精品免费观看视频| 精品国产成人在线影院| 欧美久久一区二区| 在线免费观看日韩欧美| 成人一级片网址| 国产一区999| 美女mm1313爽爽久久久蜜臀| 亚洲福利视频一区二区| 亚洲欧美区自拍先锋| 国产精品久久久久久久裸模| 久久久精品国产99久久精品芒果 | 99久久久久免费精品国产| 国产在线播放一区| 男女性色大片免费观看一区二区| 亚洲愉拍自拍另类高清精品| 亚洲日本免费电影| 亚洲欧美电影一区二区| 自拍av一区二区三区| 亚洲人成7777| 亚洲激情成人在线| 亚洲一区二区影院| 亚洲综合在线视频| 亚洲精品国产一区二区三区四区在线| 欧美激情一区二区| 国产精品不卡一区二区三区| 亚洲国产电影在线观看| 综合分类小说区另类春色亚洲小说欧美| 久久伊人中文字幕| 久久久影视传媒| 国产欧美日韩一区二区三区在线观看| 国产欧美日韩卡一| 国产精品免费视频观看| 亚洲欧美一区二区三区久本道91| 中文字幕一区av| 一区二区国产视频| 香港成人在线视频| 麻豆91精品91久久久的内涵| 黄色资源网久久资源365| 国产一区二区在线电影| 粉嫩av一区二区三区粉嫩| va亚洲va日韩不卡在线观看| 一本一道波多野结衣一区二区| 欧美三级三级三级爽爽爽| 在线播放/欧美激情| 精品欧美一区二区在线观看| 2024国产精品视频| 国产精品国产三级国产aⅴ原创 | 欧洲视频一区二区| 欧美一卡二卡三卡| 欧美激情一区二区三区| 亚洲影视在线观看| 精品一区二区免费看| 成人午夜短视频| 欧美性极品少妇| 久久人人97超碰com| 尤物av一区二区| 国产乱人伦精品一区二区在线观看 | 日本不卡不码高清免费观看| 国产成人自拍高清视频在线免费播放| 91小视频免费观看| 欧美一区二区三区喷汁尤物| 欧美国产精品久久| 日本欧美一区二区| 91丝袜美腿高跟国产极品老师| 911精品产国品一二三产区| 国产女人18毛片水真多成人如厕 | 一本到高清视频免费精品| 7777女厕盗摄久久久| 国产精品伦一区二区三级视频| 亚洲v精品v日韩v欧美v专区| 国产成人精品综合在线观看 | 亚洲精品欧美激情| 精品一区二区av| 一本大道av伊人久久综合| 精品99999| 性久久久久久久久久久久| 粉嫩在线一区二区三区视频| 日韩欧美自拍偷拍| 一区二区三区不卡在线观看| 国产精品一区二区你懂的| 欧美日本韩国一区二区三区视频| 国产精品久久久久久久久晋中| 蜜桃久久久久久| 欧美日韩极品在线观看一区| 亚洲欧美日韩国产中文在线| 国产精品一级二级三级| 欧美一级二级在线观看| 亚洲一区在线电影| 99久久99久久久精品齐齐 | 欧洲色大大久久| 亚洲三级在线观看| 国产成人免费在线观看不卡| 日韩欧美国产一区在线观看| 性做久久久久久久久| 色婷婷精品久久二区二区蜜臂av| 国产女同性恋一区二区| 国产制服丝袜一区| 日韩欧美一级片| 免费看黄色91| 日韩视频在线你懂得| 午夜精品爽啪视频| 555www色欧美视频| 秋霞午夜av一区二区三区| 欧美一区二区三区喷汁尤物| 日本三级韩国三级欧美三级|