Here a simple cognitive system with one primary user and one secondary user with Nt, Nr antenna system is assumed in underlay scenario. Due to poor rank of channel matrix between primary user transceiver(this in turn due to fading), the primary do not utilize several antennas for transmission for coherence time. These free or non transmitting modes are utilized by secondary transceiver for it's own data transmission. While doing these, secondary transmitter utilizes precoding (to null out the interference at primary user), uses whitening at secondary receiver (to mitigate the correlated noise/ interference by primary user), and ZF/MMSE/OSIC detectors (at primary as well secondary receiver to decode the respective transmitted data). Here a sample code is attached which just precode to null out the interference from secondary towards primary antenna and to convert the opportunities left by primary for secondary transmission.