Los Angeles is frequently ranked as one of the most unaffordable cities in the United States, and with home prices reaching record levels, it's not hard to see why. But just how difficult is it for an average Angeleno to buy in the LA area?

A new report from real estate website Redfin suggests it's pretty hard, with just 6.6 percent of homes listed in the greater LA region considered affordable to residents making the median income (just under $61,000, according to numbers gathered from the U.S. Census Bureau).

Only two other metro areas analyzed by Redfin—San Diego and Denver—had a lower percentage of homes affordable to residents earning the median income.

The study defines affordable homes as those that would require monthly mortgage payments that amount to under 30 percent of a buyer's income, assuming a 20 percent down payment and 3.4 percent interest rate on the loan. By that calculation, any home above $230,000 would be a stretch for median-income residents.

One of the study’s most alarming findings is that the number of homes considered affordable to typical Angelenos has plunged in the past four years.

It finds that in 2012, around 23 percent of homes on the market were affordable. Since then, despite the fact that the number of overall listings on the market has risen, the share of those affordable to median earners is down more than 70 percent.

The reason? Despite significant gains in home values, wages in the LA area have barely budged since 2012, rising less than half a percent, according to the Census numbers analyzed by Redfin.

It's harder for some residents than it is for others. According to the report, black residents can afford just over 1 percent of homes on the market in the LA area, as their median wages have declined to under $42,000 since 2012. Median Latino and Hispanic buyers can afford 2.2 percent.

Given that recent Census numbers indicate a rise in the percentage of LA area homeowners in the past two years, it seems that buyers are pushing ahead in a very competitive market. But with prices climbing higher, it remains to be seen how long that trend can continue.