Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ar;
- load('fnl24.mat');
- %{
- - 64-QAM
- - T = 1us THIS IS THE PULSE
- - fs = 16MHz
- %}
- nx = 165; ny = 306;
- npix = nx * ny;
- T = 1e-6;
- fs = 16e6;
- Ts = 1/fs;
- t = 0:Ts:T-Ts;
- g = sqrt(1/T) * ones(1, length(t));
- y = conv(v, conj(g), 'same');
- N = length(g);
- symbols = y(N:N:end)*1/T;
- bitstream = [];
- for symbol = symbols
- [~, idx] = min(abs(map - symbol));
- bits = dec2bin(idx - 1, 6);
- bitstream = [bitstream, bits];
- %binary_output(n) = strcat(bin_real, bin_imag);
- end
- bitsChannel = npix*8; % # of pixels*8bits per pixel
- bitstreamR = bitstream(1:bitsChannel);
- bitstreamG = bitstream(bitsChannel + 1:2 * bitsChannel);
- bitstreamB = bitstream(2 * bitsChannel + 1:end);
- %xR = bitPixels(bitstreamR, npix);
- pixelBitsR = reshape(bitstreamR, 8, npix)';
- xR = bin2dec(pixelBitsR);
- pixelBitsG = reshape(bitstreamG, 8, npix)';
- xG = bin2dec(pixelBitsG);
- %xG = bitPixels(bitstreamG, npix);
- pixelBitsB = reshape(bitstreamB, 8, npix)';
- xB = bin2dec(pixelBitsB);
- %xB = bitPixels(bitstreamB, npix);
- XR = reshape(xR, nx, ny);
- XG = reshape(xG, nx, ny);
- XB = reshape(xB, nx, ny);
- % construct image
- X(:, :, 1) = uint8(XR);
- X(:, :, 2) = uint8(XG);
- X(:, :, 3) = uint8(XB);
- imagesc(X);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement