problem to make fft
古いコメントを表示
hello i have this code and i want to make the fft for it to make the same bits as i start with can u help me?>
thanks alot
clear all
N=10;
fs=1e6;
T=1e-3;
% random signal
bit=randint(20,1); % 20 bits 0 or 1 1 x 20
% serial-to-parallel converter
par=reshape(bit,2,10); % 2 x 10 2 bits for sym
% mapper
sym=par'*[2;1]; % multiplay for mapper 00-0 01-1 10-2 11-3
phase=[-3*pi/4,3*pi/4,-pi/4,pi/4];
phase_sym=phase(sym+1); % every sym gets phase for example pi/4 will get '3'
% IFFT
for k=0:N-1
i=1
for t=1/fs:1/fs:T
x(k+1,i)=cos((2*pi*k*t)/T+phase_sym(k+1))+j*sin((2*pi*k*t)/T+phase_sym(k+1));
i=i+1
end
end
6 件のコメント
Jonas Reber
2011 年 6 月 6 日
isn't it true that you need 2^N samples to calculate the fft / ifft?
itsik
2011 年 6 月 6 日
Jonas Reber
2011 年 6 月 6 日
why exactly is ifft (matlab function) not an option for you?
Walter Roberson
2011 年 6 月 6 日
Jonas: no, 2^N is not required for fft / ifft. The size has to do with efficiencies in the calculation, but other sizes can still be calculated. There are even sizes that are faster to calculate than 2^N
itsik
2011 年 6 月 6 日
itsik
2011 年 6 月 8 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Transforms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!