已解决问题
针对第一个问题:在中间插0,其实还是在两边加保护带,可以参考下边的代码,(与2楼的说法类似)
% http://creativecommons.org/licenses/by-nc/2.5/in/
% Author : Krishna
% Email : [email]krishna@dsplog.com[/email]
% Version : 1.0
% Date : 02 February 2008
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% script for generting OFDM transmit waveform (loosely based on
% IEEE 802.11A specifications)
%
clear
nFFTSize = 64;
% for each symbol bits a1 to a52 are assigned to subcarrier
% index [-26 to -1 1 to 26]
subcarrierIndex = [-26:-1 1:26];
nBit = 2500;
ip = rand(1,nBit) > 0.5; % generating 1's and 0's
nBitPerSymbol = 52;
nSymbol = ceil(nBit/nBitPerSymbol);
% BPSK modulation
% bit0 --> -1
% bit1 --> +1
ipMod = 2*ip - 1;
ipMod = [ipMod zeros(1,nBitPerSymbol*nSymbol-nBit)];
ipMod = reshape(ipMod,nSymbol,nBitPerSymbol);
st = []; % empty vector
for ii = 1:nSymbol
inputiFFT = zeros(1,nFFTSize);
% assigning bits a1 to a52 to subcarriers [-26 to -1, 1 to 26]
inputiFFT(subcarrierIndex+nFFTSize/2+1) = ipMod(ii,:);
% shift subcarriers at indices [-26 to -1] to fft input indices [38 to 63]
inputiFFT = fftshift(inputiFFT);
outputiFFT = ifft(inputiFFT,nFFTSize);
% adding cyclic prefix of 16 samples
outputiFFT_with_CP = [outputiFFT(49:64) outputiFFT];
st = [st outputiFFT_with_CP];
end
close all
fsMHz = 20;
[Pxx,W] = pwelch(st,[],[],4096,20);
plot([-2048:2047]*fsMHz/4096,10*log10(fftshift(Pxx)));
xlabel('frequency, MHz')
ylabel('power spectral density')
title('Transmit spectrum OFDM (based on 802.11a)');
第二个问题:其实信号带宽还是M*f,只不过一半是正频带一半是负频带,那么最高频率就是M*f/2,因此满足奈奎斯特采样定理。
回答时间:2012-5-21 14:49
热点问题