Posts

Showing posts from January, 2025

PROGRAM MATLAH

  clc; clear all ; % Enter the value Input Continuous signal Ts=0.04; % Sampling Time period of 50 Hz signal t=0:0.0005:0.02; fs = 1/Ts; % fs>=2fm, fm = 50Hz % Plot for Input Continuous signal n1=0:40; size(n1) xa_t=sin(2*pi*2*t/Ts); subplot(2,2,1); plot(200*t,xa_t); title( 'Verification of sampling theorem' ); title( 'Input Continuous signal' ); xlabel( 't(sec)' ); ylabel( 'x(t)' ); % Sampled signal; ts1=0.002; % > Nyquist rate ts2=0.01; % = Nyquist rate ts3=0.1; % < Nyquist rate n=0:20; x_ts1=2*sin(2*pi*n*ts1/Ts); subplot(2,2,2); stem(n, x_ts1); title( 'Sampling rate greater than Nq' ); xlabel( 'n' ); ylabel( 'x(n)' ); n=0:4; x_ts2=2*sin(2*pi*n*ts2/Ts); % Use numeric pi subplot(2,2,3); stem(n, x_ts2); title( 'Sampling rate equal to Nq' ); xlabel( 'n' ); ylabel( 'x(n)' ); n=0:10; x_ts3=2*sin(2*pi*n*ts3/Ts); subplot(2,2,4); stem(n, x_ts3); title( 'Sampling rate less than Nq' ); xlabel( ...

3.1.24 Test link

https://assessment.hackerearth.com/challenges/college/mks-service-batch-test-03-01-2024/pre/  https://shorturl.at/hmzCQ https://drive.google.com/drive/folders/1-jgnirOiDN_rm2C4ccwfWYgEJGSFEzQ5

Basics of Linked List

 #include<stdio.h> #include<stdlib.h> struct lnode{     int data;     struct lnode* next; }; typedef struct lnode node; node * head = NULL; void insertAtBeginning(int val) {    node* newNode=(node*)malloc(sizeof(node));    if(newNode==NULL) {        printf("Out of memory");        return;    }    newNode -> data = val;    if(head==NULL) {             // starting node is empty        newNode -> next = NULL;        head = newNode;    }    else {                       // starting node is head        newNode -> next = head;        head = newNode;    }    printf("inserted %d at the beginning",val); } void display() {     if(head==NULL) {...