Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • GfG 160: Daily DSA
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Aptitude
  • Engineering Mathematics
  • Discrete Mathematics
  • Operating System
  • DBMS
  • Computer Networks
  • Digital Logic and Design
  • C Programming
  • Data Structures
  • Algorithms
  • Theory of Computation
  • Compiler Design
  • Computer Org and Architecture
Open In App
Next Article:
What is Modulation?
Next article icon

Analog to Analog Conversion (Modulation)

Last Updated : 17 Jul, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

Analog Signal:

An analog signal is any continuous signal for which the time varying feature of the signal is a representation of some other time varying quantity i.e., analogous to another time varying Signal.

Analog to Analog Conversion -

Analog-to-analog conversion, or modulation, is the representation of analog information by an analog signal. It is a process by virtue of which a characteristic of carrier wave is varied according to the instantaneous amplitude of the modulating signal. This modulation is generally needed when a bandpass channel is required. Bandpass is a range of frequencies which are transmitted through a bandpass filter which is a filter allowing specific frequencies to pass preventing signals at unwanted frequencies.

Analog to Analog conversion can be done in three ways:

  1. Amplitude Modulation
  2. Frequency Modulation
  3. Phase Modulation

1. AMPLITUDE MODULATION:

The modulation in which the amplitude of the carrier wave is varied according to the instantaneous amplitude of the modulating signal keeping phase and frequency as constant. The figure below shows the concept of amplitude modulation:

AM is normally implemented by using a simple multiplier because the amplitude of the carrier signal needs to be changed according to the amplitude of the modulating signal.

AM bandwidth:

The modulation creates a bandwidth that is twice the bandwidth of the modulating signal and covers a range centered on the carrier frequency.

Bandwidth= 2fm

2. FREQUENCY MODULATION -

The modulation in which the frequency of the carrier wave is varied according to the instantaneous frequency of the modulating signal keeping phase and amplitude as constant. The figure below shows the concept of frequency modulation:

FM is normally implemented by using a voltage-controlled oscillator as with FSK. The frequency of the oscillator changes according to the input voltage which is the amplitude of the modulating signal.

FM bandwidth:

  1. The bandwidth of a frequency modulated signal varies with both deviation and modulating frequency. If modulating frequency (Mf) 0.5, wide band Fm signal.
  2. For a narrow band Fm signal, bandwidth required is twice the maximum frequency of the modulation, however for a wide band Fm signal the required bandwidth can be very much larger, with detectable sidebands spreading out over large amounts of the frequency spectrum.

3. PHASE MODULATION:

The modulation in which the phase of the carrier wave is varied according to the instantaneous pIn of the modulating signal keeping amplitude and frequency as constant. The figure below shows the concept of frequency modulation:

Phase modulation is practically similar to Frequency Modulation, but in Phase modulation frequency of the carrier signal is not increased. It is normally implemented by using a voltage-controlled oscillator along with a derivative. The frequency of the oscillator changes according to the derivative of the input voltage which is the amplitude of the modulating signal.

PM bandwidth:

  1. For small amplitude signals, PM is similar to amplitude modulation (AM) and exhibits its unfortunate doubling of baseband bandwidth and poor efficiency.
  2. For a single large sinusoidal signal, PM is similar to FM, and its bandwidth is approximately, 2 (h+1) Fm where h= modulation index.

Thus, Modulation allows us to send a signal over a bandpass frequency range. If every signal gets its own frequency range, then we can transmit multiple signals simultaneously over a single channel, all using different frequency ranges.


Next Article
What is Modulation?

H

Harshita Pandey
Improve
Article Tags :
  • Misc
  • Digital Logic
Practice Tags :
  • Misc

Similar Reads

    Data Communication Tutorial
    Data communication plays an important role in today's interconnected world and enables the exchange of information between devices and networks. Whether you're sending an email, making a video call, or browsing the web, data communication ensures that information flows smoothly. This Data Communicat
    5 min read

    Basics of Data Communication

    Data Communication - Definition, Components, Types, Channels
    Transferring data over a transmission medium between two or more devices, systems, or places is known as data communication. Nowadays, computing and telecommunications depend heavily on this data transmission, which makes a variety of applications conceivable, including email, video chatting, the In
    7 min read
    Types of Computer Networks
    A computer network is a system that connects many independent computers to share information (data) and resources. The integration of computers and other different devices allows users to communicate more easily. It is a collection of two or more computer systems that are linked together. A network
    11 min read
    Transmission Modes in Computer Networks (Simplex, Half-Duplex and Full-Duplex)
    Transmission modes also known as communication modes, are methods of transferring data between devices on buses and networks designed to facilitate communication. They are classified into three types: Simplex Mode, Half-Duplex Mode, and Full-Duplex Mode. In this article, we will discuss Transmission
    6 min read
    Difference Between Serial and Parallel Transmission
    Data transmission is how computers and other devices send information to each other. There are two main ways to do this Serial and Parallel Transmission. In Serial Transmission, data is sent one bit at a time like sending a single line of people through a door. In Parallel Transmission data is sent
    4 min read
    How Data Encapsulation and De-encapsulation Works?
    Data encapsulation and de-encapsulation are fundamental concepts in computer networking and communication protocols. These processes are essential for transferring data across networks efficiently and securely. What is Data Encapsulation?Encapsulation is the process of adding additional information
    4 min read

    OSI Model

    Network Layer Services
    The network layer is a part of the communication process in computer networks. Its main job is to move data packets between different networks. It helps route these packets from the sender to the receiver across multiple paths and networks. Network-to-network connections enable the Internet to funct
    6 min read
    Transport Layer responsibilities
    The transport Layer is the second layer in the TCP/IP model and the fourth layer in the OSI model. It is an end-to-end layer used to deliver messages to a host. It is termed an end-to-end layer because it provides a point-to-point connection rather than hop-to-hop, between the source host and destin
    5 min read
    TCP/IP Model
    The TCP/IP model (Transmission Control Protocol/Internet Protocol) is a four-layer networking framework that enables reliable communication between devices over interconnected networks. It provides a standardized set of protocols for transmitting data across interconnected networks, ensuring efficie
    7 min read

    Data and Signals

    Frequency Domain Filters and its Types
    Frequency Domain Filters are used for smoothing and sharpening of image by removal of high or low frequency components. Sometimes it is possible of removal of very high and very low frequency. Frequency domain filters are different from spatial domain filters as it basically focuses on the frequency
    2 min read
    Difference Between Bit Rate and Baud Rate
    Both Bit rate and Baud rate are generally used in data communication to measure the speed of data. Bit rate refers to the number of bits transmitted per second in a communication system, while baud rate refers to the number of signal units or symbols transmitted per second. In some cases, multiple b
    3 min read

    Transmission of Signals

    Transmission Impairment in Data Communication
    In communication system, analog signals travel through transmission media, which tends to deteriorate the quality of analog signal, which means that the signal at the beginning of the medium is not the same as the signal at the end of the medium. The imperfection causes signal impairment. Below are
    3 min read
    What is Bandwidth? Definition, Working, Importance, Uses
    Pre-Requisite: Introduction to Bandwidth Network bandwidth is the maximum capacity of a wired or wireless communications link to deliver data via a network connection in a given amount of time. Bandwidth is typically defined as the number of bits, kilobits, megabits, or gigabits that may be sent in
    8 min read
    Digital To Digital Conversion in Computer Network
    In this article we will be discussing about digital-to-digital transmission in computer network i.e., how a digital data or information is converted into digital signal. The digital-to-digital encoding can be done by a technique called line coding. Line CodingThe process of converting the digital da
    5 min read
    Line Coding
    The process of converting binary data into a sequence of bits of the digital signal is known as Line coding. It is also known as digital PAM formats. Need of Line coding: We always come across different types of data such as text, numbers, graphical images, audio, and video. These all data are store
    2 min read
    Analog to Digital Conversion
    Digital Signal: A digital signal is a signal that represents data as a sequence of discrete values; at any given time it can only take on one of a finite number of values. Analog Signal: An analog signal is any continuous signal for which the time varying feature of the signal is a representation of
    6 min read
    Digital to Analog Conversion
    Digital Signal - A digital signal is a signal that represents data as a sequence of discrete values; at any given time it can only take on one of a finite number of values. Analog Signal - An analog signal is any continuous signal for which the time varying feature of the signal is a representation
    3 min read
    Quadrature Amplitude Modulation
    Quadrature Amplitude Modulation (QAM) is a modulation technique that can be utilized in Analog modulation concepts and digital modulation concepts. It is a combination of ASK and PSK. So, in this article, we will discuss QAM, Analog QAM, Digital QAM, and many more. Quadrature Amplitude Modulation:Qu
    5 min read
    Analog to Analog Conversion (Modulation)
    Analog Signal: An analog signal is any continuous signal for which the time varying feature of the signal is a representation of some other time varying quantity i.e., analogous to another time varying Signal. Analog to Analog Conversion - Analog-to-analog conversion, or modulation, is the represent
    3 min read
    What is Modulation?
    Modulation can be digital or analog, the input wave of the analog signal varies continuously like a sine wave. Modulation can be defined as the process of converting data into waves by adding information to a carrier signal. Such a signal can be transmitted electronically or optically, but it must h
    6 min read

    Multiplexing

    Multiplexing (Channel Sharing) in Computer Network
    Multiplexing means multiple sources but one link. An alternative approach is a Direct point-to-point connection, but it has several problems as it requires an I/O port for each device, a need line for each device, and also a large amount of wiring needed if on different floors. Instead, if we use a
    9 min read
    Types of Multiplexing in Data Communications
    Imagine you have several friends who all want to send letters to the same person at the same time. Instead of sending each letter individually, which would take a lot of time and effort, you put all the letters into one big envelope and send that. When the big envelope arrives, the letters are taken
    6 min read
    Frequency Division and Time division multiplexing
    Multiplexing is used in cases where the signals of lower bandwidth and the transmitting media is having higher bandwidth. In this case, the possibility of sending a number of signals is more. In this, the signals are combined into one and are sent over a link that has greater bandwidth of media than
    4 min read

    Transmission Media

    Types of Transmission Media
    Transmission media is the physical medium through which data is transmitted from one device to another within a network. These media can be wired or wireless. The choice of medium depends on factors like distance, speed, and interference. In this article, we will discuss the transmission media. In t
    9 min read
    Twisted-pair Cable
    Twisted-pair Cable is a transmission media. Transmission media refers to the physical path or medium used to transmit data between devices. It can be divided into two parts: Guided Media and Unguided Media. In guided media, the signal is contained within the physical limits of the transmission mediu
    4 min read
    What is Coaxial Cable ?
    Coaxial cable is typically used by cable operators, telephone companies, and internet providers to transmit data, video, and voice communications to customers. Its installation and implementation are easy but it is less efficient than optical fiber also it provides moderately low bandwidth in compar
    6 min read
    Fiber Optics and Types
    Fiber Optics or Optical Fiber is a technology that transmits data as a light pulse along a glass or plastic fiber. An Optical Fiber is a cylindrical fiber of glass that is hair-thin in size or any transparent dielectric medium. The fiber which is used for optical communication is waveguides made of
    6 min read
    Difference between Twisted pair cable, Co-axial cable and Optical fiber cable
    A computer cable is a medium used to transmit data between devices such as computers, servers, routers, and switches. Cables physically connect these devices, enabling them to communicate within a network. In computer networking, it is very important to know the distinctions between the different ty
    8 min read
    Radio Waves
    Radio waves are a special type of energy that travels through space, carrying information without needing wires. They have the longest wavelengths in the electromagnetic spectrum, meaning they stretch out much farther than other waves like visible light or X-rays. These waves can be incredibly long,
    9 min read
    Infrared light for Transmission
    Infrared light for Transmission :Infrared is the frequency of light that is not visible to the eyes .The frequency of the waves lies between three hundred gigacycles to four hundred THz. In this, the radiation is in the region of the electromagnetic spectrum . Infrared could be a communication mediu
    3 min read
    Difference between Guided and Unguided Media
    Network media or transmission media refer to the physical pathways through which data is transmitted from one device to another within a network. These ways can be wired or wireless. The selection of media depends on factors like distance, speed, and interference. In this article, we will discuss th
    4 min read

    Error Detection and Correction

    Error Detection in Computer Networks
    Error is a condition when the receiver's information does not match the sender's. Digital signals suffer from noise during transmission that can introduce errors in the binary bits traveling from sender to receiver. That means a 0 bit may change to 1 or a 1 bit may change to 0. Data (Implemented eit
    7 min read
    Forward Error Correction in Computer Networks
    Forward Error Correction (FEC) is a technique used to minimize errors in data transmission over communication channels. In real-time multimedia transmission, re-transmission of corrupted and lost packets is not useful because it creates an unacceptable delay in reproducing : one needs to wait until
    3 min read
    Vertical Redundancy Check (VRC) or Parity Check
    Vertical Redundancy Check is also known as Parity Check. In this method, a redundant bit also called parity bit is added to each data unit. This method includes even parity and odd parity. Even parity means the total number of 1s in data is to be even and odd parity means the total number of 1s in d
    3 min read
    Longitudinal Redundancy Check (LRC)/2-D Parity Check
    Longitudinal Redundancy Check (LRC) is also known as 2-D parity check. In this method, data which the user want to send is organised into tables of rows and columns. A block of bit is divided into table or matrix of rows and columns. In order to detect an error, a redundant bit is added to the whole
    2 min read
    Hamming Code in Computer Network
    Hamming code is an error-correcting code used to ensure data accuracy during transmission or storage. Hamming code detects and corrects the errors that can occur when the data is moved or stored from the sender to the receiver. This simple and effective method helps improve the reliability of commun
    10 min read
    Concepts of hamming distance
    Hamming Distance Problem: In general, it is assumed that it is more likely to have fewer errors than more errors. This “worst-case” approach to coding is intuitively appealing within itself. Nevertheless, it is closely connected to a simple probabilistic model where errors are introduced into the me
    2 min read
    Error Detection Code - Checksum
    Checksum is the error detection method used by upper-layer protocols and is considered to be more reliable than Longitudinal Redundancy Check (LRC), Vertical Redundancy Check (VRC), and Cyclic Redundancy Check (CRC). This method uses a Checksum Generator on the sender side and a Checksum Checker on
    4 min read

    Channelization

    Frequency Division Multiple Access (FDMA) Techniques
    In Frequency-Division Multiple Access the channel bandwidth is subdivided into a variety of sub-channels. FDMA is used for voice and data transmission. During this method the general channel bandwidth is shared by multiple users, therefore a variety of users can transmit their data simultaneously. N
    5 min read
    CDMA Full Form
    CDMA stands for Code Division Multiple Access. It is basically a channel access method and is also an example of multiple access. Multiple access basically means that information by several transmitters can be sent simultaneously onto a single communication channel. There are multiple users which ar
    4 min read
    What is Ethernet?
    A LAN is a data communication network connecting various terminals or computers within a building or limited geographical area. The connection between the devices could be wired or wireless. Ethernet, Token rings, and Wireless LAN using IEEE 802.11 are examples of standard LAN technologies.In this a
    9 min read
    Bridges (local Internetworking device)
    Prerequisites - Network Devices, Types of switches Bridge is a local internetworking device that is used to connect two or more network segments together. A bridge operates at the Data Link Layer (Layer 2) of the OSI model and uses the MAC addresses of devices to make forwarding decisions. Bridges w
    6 min read
    Introduction of Gigabit Ethernet
    The committee began working on a faster Ethernet, quickly dubbed gigabit Ethernet. The goal was to increase performance while maintaining all Ethernet standards. Gigabit Ethernet had to provide service with both unicast and broadcast using the same 48-bit address scheme and also maintaining the same
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

'); // $('.spinner-loading-overlay').show(); let script = document.createElement('script'); script.src = 'https://assets.geeksforgeeks.org/v2/editor-prod/static/js/bundle.min.js'; script.defer = true document.head.appendChild(script); script.onload = function() { suggestionModalEditor() //to add editor in suggestion modal if(loginData && loginData.premiumConsent){ personalNoteEditor() //to load editor in personal note } } script.onerror = function() { if($('.editorError').length){ $('.editorError').remove(); } var messageDiv = $('
').text('Editor not loaded due to some issues'); $('#suggestion-section-textarea').append(messageDiv); $('.suggest-bottom-btn').hide(); $('.suggestion-section').hide(); editorLoaded = false; } }); //suggestion modal editor function suggestionModalEditor(){ // editor params const params = { data: undefined, plugins: ["BOLD", "ITALIC", "UNDERLINE", "PREBLOCK"], } // loading editor try { suggestEditorInstance = new GFGEditorWrapper("suggestion-section-textarea", params, { appNode: true }) suggestEditorInstance._createEditor("") $('.spinner-loading-overlay:eq(0)').remove(); editorLoaded = true; } catch (error) { $('.spinner-loading-overlay:eq(0)').remove(); editorLoaded = false; } } //personal note editor function personalNoteEditor(){ // editor params const params = { data: undefined, plugins: ["UNDO", "REDO", "BOLD", "ITALIC", "NUMBERED_LIST", "BULLET_LIST", "TEXTALIGNMENTDROPDOWN"], placeholderText: "Description to be......", } // loading editor try { let notesEditorInstance = new GFGEditorWrapper("pn-editor", params, { appNode: true }) notesEditorInstance._createEditor(loginData&&loginData.user_personal_note?loginData.user_personal_note:"") $('.spinner-loading-overlay:eq(0)').remove(); editorLoaded = true; } catch (error) { $('.spinner-loading-overlay:eq(0)').remove(); editorLoaded = false; } } var lockedCasesHtml = `You can suggest the changes for now and it will be under 'My Suggestions' Tab on Write.

You will be notified via email once the article is available for improvement. Thank you for your valuable feedback!`; var badgesRequiredHtml = `It seems that you do not meet the eligibility criteria to create improvements for this article, as only users who have earned specific badges are permitted to do so.

However, you can still create improvements through the Pick for Improvement section.`; jQuery('.improve-header-sec-child').on('click', function(){ jQuery('.improve-modal--overlay').hide(); $('.improve-modal--suggestion').hide(); jQuery('#suggestion-modal-alert').hide(); }); $('.suggest-change_wrapper, .locked-status--impove-modal .improve-bottom-btn').on('click',function(){ // when suggest changes option is clicked $('.ContentEditable__root').text(""); $('.suggest-bottom-btn').html("Suggest changes"); $('.thank-you-message').css("display","none"); $('.improve-modal--improvement').hide(); $('.improve-modal--suggestion').show(); $('#suggestion-section-textarea').show(); jQuery('#suggestion-modal-alert').hide(); if(suggestEditorInstance !== null){ suggestEditorInstance.setEditorValue(""); } $('.suggestion-section').css('display', 'block'); jQuery('.suggest-bottom-btn').css("display","block"); }); $('.create-improvement_wrapper').on('click',function(){ // when create improvement option clicked then improvement reason will be shown if(loginData && loginData.isLoggedIn) { $('body').append('
'); $('.spinner-loading-overlay').show(); jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.unlocked-status--improve-modal-content').css("display","none"); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { showErrorMessage(e.responseJSON,e.status) }, }); } else { if(loginData && !loginData.isLoggedIn) { $('.improve-modal--overlay').hide(); if ($('.header-main__wrapper').find('.header-main__signup.login-modal-btn').length) { $('.header-main__wrapper').find('.header-main__signup.login-modal-btn').click(); } return; } } }); $('.left-arrow-icon_wrapper').on('click',function(){ if($('.improve-modal--suggestion').is(":visible")) $('.improve-modal--suggestion').hide(); else{ } $('.improve-modal--improvement').show(); }); const showErrorMessage = (result,statusCode) => { if(!result) return; $('.spinner-loading-overlay:eq(0)').remove(); if(statusCode == 403) { $('.improve-modal--improve-content.error-message').html(result.message); jQuery('.improve-modal--overlay').show(); jQuery('.improve-modal--improvement').show(); $('.locked-status--impove-modal').css("display","block"); $('.unlocked-status--improve-modal-content').css("display","none"); $('.improve-modal--improvement').attr("status","locked"); return; } } function suggestionCall() { var editorValue = suggestEditorInstance.getValue(); var suggest_val = $(".ContentEditable__root").find("[data-lexical-text='true']").map(function() { return $(this).text().trim(); }).get().join(' '); suggest_val = suggest_val.replace(/\s+/g, ' ').trim(); var array_String= suggest_val.split(" ") //array of words var gCaptchaToken = $("#g-recaptcha-response-suggestion-form").val(); var error_msg = false; if(suggest_val != "" && array_String.length >=4){ if(editorValue.length <= 2000){ var payload = { "gfg_post_id" : `${post_id}`, "suggestion" : `${editorValue}`, } if(!loginData || !loginData.isLoggedIn) // User is not logged in payload["g-recaptcha-token"] = gCaptchaToken jQuery.ajax({ type:'post', url: "https://apiwrite.geeksforgeeks.org/suggestions/auth/create/", xhrFields: { withCredentials: true }, crossDomain: true, contentType:'application/json', data: JSON.stringify(payload), success:function(data) { if(!loginData || !loginData.isLoggedIn) { grecaptcha.reset(); } jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('.suggest-bottom-btn').css("display","none"); $('#suggestion-section-textarea').hide() $('.thank-you-message').css('display', 'flex'); $('.suggestion-section').css('display', 'none'); jQuery('#suggestion-modal-alert').hide(); }, error:function(data) { if(!loginData || !loginData.isLoggedIn) { grecaptcha.reset(); } jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Something went wrong."); jQuery('#suggestion-modal-alert').show(); error_msg = true; } }); } else{ jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Minimum 4 Words and Maximum Words limit is 1000."); jQuery('#suggestion-modal-alert').show(); jQuery('.ContentEditable__root').focus(); error_msg = true; } } else{ jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Enter atleast four words !"); jQuery('#suggestion-modal-alert').show(); jQuery('.ContentEditable__root').focus(); error_msg = true; } if(error_msg){ setTimeout(() => { jQuery('.ContentEditable__root').focus(); jQuery('#suggestion-modal-alert').hide(); }, 3000); } } document.querySelector('.suggest-bottom-btn').addEventListener('click', function(){ jQuery('body').append('
'); jQuery('.spinner-loading-overlay').show(); if(loginData && loginData.isLoggedIn) { suggestionCall(); return; } // script for grecaptcha loaded in loginmodal.html and call function to set the token setGoogleRecaptcha(); }); $('.improvement-bottom-btn.create-improvement-btn').click(function() { //create improvement button is clicked $('body').append('
'); $('.spinner-loading-overlay').show(); // send this option via create-improvement-post api jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { showErrorMessage(e.responseJSON,e.status); }, }); });
"For an ad-free experience and exclusive features, subscribe to our Premium Plan!"
Continue without supporting
`; $('body').append(adBlockerModal); $('body').addClass('body-for-ad-blocker'); const modal = document.getElementById("adBlockerModal"); modal.style.display = "block"; } function handleAdBlockerClick(type){ if(type == 'disabled'){ window.location.reload(); } else if(type == 'info'){ document.getElementById("ad-blocker-div").style.display = "none"; document.getElementById("ad-blocker-info-div").style.display = "flex"; handleAdBlockerIconClick(0); } } var lastSelected= null; //Mapping of name and video URL with the index. const adBlockerVideoMap = [ ['Ad Block Plus','https://media.geeksforgeeks.org/auth-dashboard-uploads/abp-blocker-min.mp4'], ['Ad Block','https://media.geeksforgeeks.org/auth-dashboard-uploads/Ad-block-min.mp4'], ['uBlock Origin','https://media.geeksforgeeks.org/auth-dashboard-uploads/ub-blocke-min.mp4'], ['uBlock','https://media.geeksforgeeks.org/auth-dashboard-uploads/U-blocker-min.mp4'], ] function handleAdBlockerIconClick(currSelected){ const videocontainer = document.getElementById('ad-blocker-info-div-gif'); const videosource = document.getElementById('ad-blocker-info-div-gif-src'); if(lastSelected != null){ document.getElementById("ad-blocker-info-div-icons-"+lastSelected).style.backgroundColor = "white"; document.getElementById("ad-blocker-info-div-icons-"+lastSelected).style.borderColor = "#D6D6D6"; } document.getElementById("ad-blocker-info-div-icons-"+currSelected).style.backgroundColor = "#D9D9D9"; document.getElementById("ad-blocker-info-div-icons-"+currSelected).style.borderColor = "#848484"; document.getElementById('ad-blocker-info-div-name-span').innerHTML = adBlockerVideoMap[currSelected][0] videocontainer.pause(); videosource.setAttribute('src', adBlockerVideoMap[currSelected][1]); videocontainer.load(); videocontainer.play(); lastSelected = currSelected; }

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences